Skip to content

Commit

Permalink
add port counts to vmstats
Browse files Browse the repository at this point in the history
  • Loading branch information
djnym committed Dec 4, 2015
1 parent f33fa1e commit c8a26c7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 5.6.0 (molinaro)
* add port count and limit to vmstats

Version 5.5.2 (molinaro)
* syntax_tools needs to be in the required apps

Expand Down
2 changes: 1 addition & 1 deletion src/mondemand.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ application, mondemand,
[
{ description, "Erlang Mondemand Bindings." },
{ vsn, "5.5.1" },
{ vsn, "5.6.0" },
{ modules, [] },
{ registered, [mondemand,mondemand_sup]},
{ applications, [kernel,stdlib,syntax_tools,lwes]},
Expand Down
32 changes: 21 additions & 11 deletions src/mondemand_vmstats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
memory_binary,
memory_ets,
process_count,
process_limit
process_limit,
port_count,
port_limit
}).

%-=====================================================================-
Expand Down Expand Up @@ -166,14 +168,16 @@ collect_sample () ->
),

Memory = erlang:memory(),
TotalMemory = proplists:get_value (total, Memory),
ProcessMemory = proplists:get_value (processes_used, Memory),
SystemMemory = proplists:get_value (system, Memory),
AtomUsed = proplists:get_value (atom_used, Memory),
BinaryMemory = proplists:get_value (binary, Memory),
EtsMemory = proplists:get_value (ets, Memory),
ProcessCount = erlang:system_info (process_count),
TotalMemory = proplists:get_value(total, Memory),
ProcessMemory = proplists:get_value(processes_used, Memory),
SystemMemory = proplists:get_value(system, Memory),
AtomUsed = proplists:get_value(atom_used, Memory),
BinaryMemory = proplists:get_value(binary, Memory),
EtsMemory = proplists:get_value(ets, Memory),
ProcessCount = erlang:system_info(process_count),
ProcessLimit = erlang:system_info(process_limit),
PortCount = erlang:system_info(port_count),
PortLimit = erlang:system_info(port_limit),

#vm_sample {
timestamp = Timestamp,
Expand All @@ -194,7 +198,9 @@ collect_sample () ->
memory_binary = BinaryMemory,
memory_ets = EtsMemory,
process_count = ProcessCount,
process_limit = ProcessLimit
process_limit = ProcessLimit,
port_count = PortCount,
port_limit = PortLimit
}.

to_mondemand (#vm_sample {
Expand Down Expand Up @@ -226,7 +232,9 @@ to_mondemand (#vm_sample {
memory_binary = BinaryMemory,
memory_ets = EtsMemory,
process_count = ProcessCount,
process_limit = ProcessLimit
process_limit = ProcessLimit,
port_count = PortCount,
port_limit = PortLimit
}) ->
[
{ gauge, context_switches, ContextSwitches - PrevContextSwitches },
Expand All @@ -246,7 +254,9 @@ to_mondemand (#vm_sample {
{ gauge, memory_binary, BinaryMemory },
{ gauge, memory_ets, EtsMemory },
{ gauge, process_count, ProcessCount },
{ gauge, process_limit, ProcessLimit }
{ gauge, process_limit, ProcessLimit },
{ gauge, port_count, PortCount },
{ gauge, port_limit, PortLimit }
].

%%--------------------------------------------------------------------
Expand Down

0 comments on commit c8a26c7

Please sign in to comment.