Skip to content

Add memory usage profiling for running tests #277

Closed
@avtikhon

Description

@avtikhon

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:

test-run/lib/utils.py

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions