MCPcopy
hub / github.com/dask/dask / test_resource_profiler_multiple_gets

Function test_resource_profiler_multiple_gets

dask/diagnostics/tests/test_profiler.py:108–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106
107@pytest.mark.skipif("not psutil")
108def test_resource_profiler_multiple_gets():
109 with ResourceProfiler(dt=0.01) as rprof:
110 get(dsk2, "c")
111 assert len(rprof.results) == 0
112 get(dsk2, "c")
113 results = rprof.results
114 assert all(isinstance(i, tuple) and len(i) == 3 for i in results)
115
116 rprof.clear()
117 rprof.register()
118 get(dsk2, "c")
119 assert len(rprof.results) > 0
120 get(dsk2, "c")
121 rprof.unregister()
122
123 results = rprof.results
124 assert all(isinstance(i, tuple) and len(i) == 3 for i in results)
125
126 rprof.close()
127 assert not rprof._is_running()
128
129
130def test_cache_profiler():

Callers

nothing calls this directly

Calls 8

ResourceProfilerClass · 0.90
getFunction · 0.90
allFunction · 0.85
unregisterMethod · 0.80
closeMethod · 0.80
_is_runningMethod · 0.80
clearMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…