File: max_mem_usage_from_log.py

package info (click to toggle)
minia 3.2.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,024 kB
  • sloc: cpp: 1,377; sh: 395; python: 208; makefile: 11
file content (13 lines) | stat: -rw-r--r-- 264 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
import sys
max_mem = 0
for line in sys.stdin: 
    s = line.replace(']','').split()
    if 'MB' not in s:
        continue
    i=s.index('MB')
    if s[i-1].isdigit(): 
        mem=int(s[i-1])
        max_mem=max(mem,max_mem)

print(max_mem)