MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / print_stats

Function print_stats

misc/python/materialize/benches/avro_ingest.py:58–68  ·  view source on GitHub ↗
(container: Container, prev: PrevStats, file: IO)

Source from the content-addressed store, hash-verified

56
57
58def print_stats(container: Container, prev: PrevStats, file: IO) -> PrevStats:
59 proc = mz_proc(container)
60 memory = proc.memory_info()
61 cpu = proc.cpu_times()
62 new_prev = PrevStats(time.time(), cpu.user, cpu.system)
63 print(
64 f"{memory.rss},{memory.vms},{new_prev.user_cpu - prev.user_cpu},{new_prev.system_cpu - prev.system_cpu},{new_prev.wall_time - prev.wall_time}",
65 file=file,
66 flush=True,
67 )
68 return new_prev
69
70
71def main() -> None:

Callers 1

mainFunction · 0.70

Calls 2

mz_procFunction · 0.85
PrevStatsClass · 0.85

Tested by

no test coverage detected