home
/
code
/
beam_stats.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix missing newline in Graphite msg serialization
[beam_stats.git]
/
src
/
beam_stats_processes.erl
diff --git
a/src/beam_stats_processes.erl
b/src/beam_stats_processes.erl
index
2505178
..
607376c
100644
(file)
--- a/
src/beam_stats_processes.erl
+++ b/
src/beam_stats_processes.erl
@@
-8,8
+8,8
@@
]).
-export(
]).
-export(
- [ collect/
0
- , collect_and_print/
0
+ [ collect/
1
+ , collect_and_print/
1
, print/1
]).
, print/1
]).
@@
-18,10
+18,12
@@
-type t() ::
?T{}.
-type t() ::
?T{}.
--spec collect() ->
+-spec collect(
beam_stats_delta:t()
) ->
t().
t().
-collect() ->
- Ps = [beam_stats_process:of_pid(P) || P <- erlang:processes()],
+collect(DeltasServer) ->
+ Pids = beam_stats_source:erlang_processes(),
+ PsOpts = [beam_stats_process:of_pid(P, DeltasServer) || P <- Pids],
+ Ps = [P || {some, P} <- PsOpts],
?T
{ individual_stats
= Ps
?T
{ individual_stats
= Ps
@@
-32,7
+34,7
@@
collect() ->
, count_garbage_collecting
= length([P || P <- Ps, P#beam_stats_process.status =:= garbage_collecting])
, count_registered
, count_garbage_collecting
= length([P || P <- Ps, P#beam_stats_process.status =:= garbage_collecting])
, count_registered
- = length(registered())
+ = length(
beam_stats_source:erlang_
registered())
, count_runnable
= length([P || P <- Ps, P#beam_stats_process.status =:= runnable])
, count_running
, count_runnable
= length([P || P <- Ps, P#beam_stats_process.status =:= runnable])
, count_running
@@
-43,8
+45,10
@@
collect() ->
= length([P || P <- Ps, P#beam_stats_process.status =:= waiting])
}.
= length([P || P <- Ps, P#beam_stats_process.status =:= waiting])
}.
-collect_and_print() ->
- print(collect()).
+-spec collect_and_print(beam_stats_delta:t()) ->
+ ok.
+collect_and_print(DeltasServer) ->
+ print(collect(DeltasServer)).
-spec print(t()) ->
ok.
-spec print(t()) ->
ok.
@@
-63,7
+67,8
@@
print(
) ->
PerProcessStatsSorted = lists:sort(
fun (#beam_stats_process{memory=A}, #beam_stats_process{memory=B}) ->
) ->
PerProcessStatsSorted = lists:sort(
fun (#beam_stats_process{memory=A}, #beam_stats_process{memory=B}) ->
- % From lowest to highest:
+ % From lowest to highest, so that the largest appears the end of
+ % the output and be easier to see (without scrolling back):
A < B
end,
PerProcessStats
A < B
end,
PerProcessStats
This page took
0.043715 seconds
and
4
git commands to generate.