aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2013-11-14 15:34:55 +0100
committerDan Gudmundsson <[email protected]>2014-01-27 16:13:57 +0100
commitcf20035dc7a4fbab47ce17b99b674e4db5eb7a07 (patch)
tree2cb48cabb34977d3f465ad38def55df70bdfe509 /lib/runtime_tools/src
parentbfae535d4ac51d2c3bef146e0f058e105bb5e956 (diff)
downloadotp-cf20035dc7a4fbab47ce17b99b674e4db5eb7a07.tar.gz
otp-cf20035dc7a4fbab47ce17b99b674e4db5eb7a07.tar.bz2
otp-cf20035dc7a4fbab47ce17b99b674e4db5eb7a07.zip
observer: Fix memory and scheduler info and handle missing fields
Fix app viewer crash
Diffstat (limited to 'lib/runtime_tools/src')
-rw-r--r--lib/runtime_tools/src/observer_backend.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index 202129c61a..68ef04f20c 100644
--- a/lib/runtime_tools/src/observer_backend.erl
+++ b/lib/runtime_tools/src/observer_backend.erl
@@ -53,6 +53,13 @@ sys_info() ->
Mem -> Mem
catch _:_ -> []
end,
+
+ SchedulersOnline = erlang:system_info(schedulers_online),
+ SchedulersAvailable = case erlang:system_info(multi_scheduling) of
+ enabled -> SchedulersOnline;
+ _ -> 1
+ end,
+
{{_,Input},{_,Output}} = erlang:statistics(io),
[{process_count, erlang:system_info(process_count)},
{process_limit, erlang:system_info(process_limit)},
@@ -60,9 +67,13 @@ sys_info() ->
{run_queue, erlang:statistics(run_queue)},
{io_input, Input},
{io_output, Output},
+
{logical_processors, erlang:system_info(logical_processors)},
- {logical_processors_available, erlang:system_info(logical_processors_available)},
{logical_processors_online, erlang:system_info(logical_processors_online)},
+ {logical_processors_available, erlang:system_info(logical_processors_available)},
+ {schedulers, erlang:system_info(schedulers)},
+ {schedulers_online, SchedulersOnline},
+ {schedulers_available, SchedulersAvailable},
{otp_release, erlang:system_info(otp_release)},
{version, erlang:system_info(version)},
@@ -221,7 +232,7 @@ fetch_stats_loop(Parent, Time) ->
_M = Parent ! {stats, 1,
erlang:statistics(scheduler_wall_time),
erlang:statistics(io),
- erlang:memory()},
+ try erlang:memory() catch _:_ -> [] end},
fetch_stats_loop(Parent, Time)
end.
%%