aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src/observer_backend.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-12-12 16:34:32 +0100
committerSiri Hansen <[email protected]>2016-12-12 16:34:32 +0100
commit40e5a09362042adfccc5964bde48a2dce27373fd (patch)
tree349f52daef265910e884d698f1d258e0458d795b /lib/runtime_tools/src/observer_backend.erl
parentb47d104994c6f11301f23b0675ed5f06f3e25922 (diff)
downloadotp-40e5a09362042adfccc5964bde48a2dce27373fd.tar.gz
otp-40e5a09362042adfccc5964bde48a2dce27373fd.tar.bz2
otp-40e5a09362042adfccc5964bde48a2dce27373fd.zip
[etop] Show CPU utilization for last interval only
Since commit 265998a7e412cd382315632964846569c370a5a2, etop reports the CPU (scheduler) utilization since the tool was started instead of for the last interval only. This is now corrected.
Diffstat (limited to 'lib/runtime_tools/src/observer_backend.erl')
-rw-r--r--lib/runtime_tools/src/observer_backend.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index e943fb4a3e..b27bc63d15 100644
--- a/lib/runtime_tools/src/observer_backend.erl
+++ b/lib/runtime_tools/src/observer_backend.erl
@@ -314,13 +314,12 @@ etop_collect(Collector) ->
case SchedulerWallTime of
undefined ->
- spawn(fun() -> flag_holder_proc(Collector) end),
+ erlang:system_flag(scheduler_wall_time,true),
+ spawn(fun() -> flag_holder_proc(Collector) end),
ok;
_ ->
ok
- end,
-
- erlang:system_flag(scheduler_wall_time,true).
+ end.
flag_holder_proc(Collector) ->
Ref = erlang:monitor(process,Collector),