waasdorp reports in bug #40 that we are raising an exception if
a line in proc_meminfo.log is not well formed.
He is right because we were trying to access matches of a regexp
that did not match.
That is obviously silly but it is also silly to stop processing
all the data if a line is wrong, even a line that we are not
interested in it. Instead ignore the line and skip the sample
if it is not valid.
Example of broken line:
Shmem:
While at it remove an unused variable
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Parse file for global memory statistics.
The format of relevant lines should be: ^key: value( unit)?
"""
- used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
-
mem_stats = []
meminfo_re = re.compile(r'([^ \t:]+):\s*(\d+).*')