diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-07-25 11:37:52 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-07-25 11:37:52 +0100 |
commit | e9bcae802cfa276d5d8ce6cc2b56fe5816e57493 (patch) | |
tree | 6a4c9588d2ba7cd7560408cfe4d500072a44beb2 | |
parent | 22f5356c054912a4d59c27b06743f88b50655220 (diff) | |
download | rabbitmq-server-e9bcae802cfa276d5d8ce6cc2b56fe5816e57493.tar.gz |
Inlinebug26290
-rw-r--r-- | src/vm_memory_monitor.erl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl index 3f4948f5..52d09e20 100644 --- a/src/vm_memory_monitor.erl +++ b/src/vm_memory_monitor.erl @@ -309,7 +309,9 @@ parse_line_mach(Line) -> {list_to_atom(Name), list_to_integer(Value)} end. -extract_name_and_value_linux(Line) -> +%% A line looks like "MemTotal: 502968 kB" +%% or (with broken OS/modules) "Readahead 123456 kB" +parse_line_linux(Line) -> {Name, Value, UnitRest} = case string:tokens(Line, ":") of %% no colon in the line @@ -325,13 +327,7 @@ extract_name_and_value_linux(Line) -> [] -> list_to_integer(Value); %% no units ["kB"] -> list_to_integer(Value) * 1024 end, - {Name, Value1}. - -%% A line looks like "MemTotal: 502968 kB" -%% or (with broken OS/modules) "Readahead 123456 kB" -parse_line_linux(Line) -> - {Name, Val} = extract_name_and_value_linux(Line), - {list_to_atom(Name), Val}. + {list_to_atom(Name), Value1}. %% A line looks like "Memory size: 1024 Megabytes" parse_line_sunos(Line) -> |