MCPcopy Index your code
hub / github.com/pythonprofilers/memory_profiler / MemitResult

Class MemitResult

memory_profiler.py:62–84  ·  view source on GitHub ↗

memit magic run details. Object based on IPython's TimeitResult

Source from the content-addressed store, hash-verified

60
61
62class MemitResult(object):
63 """memit magic run details.
64
65 Object based on IPython's TimeitResult
66 """
67
68 def __init__(self, mem_usage, baseline, repeat, timeout, interval,
69 include_children):
70 self.mem_usage = mem_usage
71 self.baseline = baseline
72 self.repeat = repeat
73 self.timeout = timeout
74 self.interval = interval
75 self.include_children = include_children
76
77 def __str__(self):
78 max_mem = max(self.mem_usage)
79 inc = max_mem - self.baseline
80 return 'peak memory: %.02f MiB, increment: %.02f MiB' % (max_mem, inc)
81
82 def _repr_pretty_(self, p, cycle):
83 msg = str(self)
84 p.text(u'<MemitResult : ' + msg + u'>')
85
86
87def _get_child_memory(process, meminfo_attr=None, memory_metric=0):

Callers 1

memitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected