MCPcopy Create free account
hub / github.com/PyTables/PyTables / show_stats

Function show_stats

bench/open_close-bench.py:21–40  ·  view source on GitHub ↗

Show the used memory

(explain, tref)

Source from the content-addressed store, hash-verified

19
20
21def show_stats(explain, tref):
22 "Show the used memory"
23 for line in Path("/proc/self/status").read_text().splitlines():
24 if line.startswith("VmSize:"):
25 vmsize = int(line.split()[1])
26 elif line.startswith("VmRSS:"):
27 vmrss = int(line.split()[1])
28 elif line.startswith("VmData:"):
29 vmdata = int(line.split()[1])
30 elif line.startswith("VmStk:"):
31 vmstk = int(line.split()[1])
32 elif line.startswith("VmExe:"):
33 vmexe = int(line.split()[1])
34 elif line.startswith("VmLib:"):
35 vmlib = int(line.split()[1])
36 print("WallClock time:", clock() - tref)
37 print("Memory usage: ******* %s *******" % explain)
38 print(f"VmSize: {vmsize:>7} kB\tVmRSS: {vmrss:>7} kB")
39 print(f"VmData: {vmdata:>7} kB\tVmStk: {vmstk:>7} kB")
40 print(f"VmExe: {vmexe:>7} kB\tVmLib: {vmlib:>7} kB")
41
42
43def check_open_close():

Callers 9

check_open_closeFunction · 0.70
check_only_openFunction · 0.70
check_full_browseFunction · 0.70
check_partial_browseFunction · 0.70
check_full_browse_attrsFunction · 0.70
check_open_groupFunction · 0.70
check_open_leafFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected