-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Need to add routines which will collect memory usage in runtime for tests. It is needed to resolve main issue
tarantool/tarantool-qa#98
RSS memory usage file to parse:
/sys/fs/cgroup/memory/memory.limit_in_bytes
Style example of implementation:
Lines 215 to 233 in 5baa4f0
def format_process(pid): | |
cmdline = 'unknown' | |
try: | |
with open('/proc/%d/cmdline' % pid, 'r') as f: | |
cmdline = ' '.join(f.read().split('\0')).strip() or cmdline | |
except (OSError, IOError): | |
pass | |
status = 'unknown' | |
try: | |
with open('/proc/%d/status' % pid, 'r') as f: | |
for line in f: | |
if ':' not in line: | |
continue | |
key, value = line.split(':', 1) | |
if key == 'State': | |
status = value.strip() | |
except (OSError, IOError): | |
pass | |
return 'process %d [%s; %s]' % (pid, status, cmdline) |
Metadata
Metadata
Assignees
Labels
No labels