From e9bcae802cfa276d5d8ce6cc2b56fe5816e57493 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Fri, 25 Jul 2014 11:37:52 +0100 Subject: Inline --- src/vm_memory_monitor.erl | 12 ++++-------- 1 file 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) -> -- cgit v1.2.1