def test_statistical_profiling_cycle(c, s, a, b): futures = c.map(slowinc, range(20), delay=0.05) yield wait(futures) yield gen.sleep(0.01) end = time() assert len(a.profile_history) > 3 x = a.get_profile(start=time() + 10, stop=time() + 20) assert not x['count'] x = a.get_profile(start=0, stop=time()) assert x['count'] == sum(p['count'] for _, p in a.profile_history) + a.profile_recent['count'] y = a.get_profile(start=end - 0.300, stop=time()) assert 0 < y['count'] <= x['count']
def test_statistical_profiling_2(c, s, a, b): da = pytest.importorskip("dask.array") for i in range(5): x = da.random.random(1000000, chunks=(10000, )) y = (x + x * 2) - x.sum().persist() yield wait(y) profile = a.get_profile() assert profile["count"] assert "sum" in str(profile) or "random" in str(profile)
def test_statistical_profiling_2(c, s, a, b): da = pytest.importorskip('dask.array') for i in range(5): x = da.random.random(1000000, chunks=(10000,)) y = (x + x * 2) - x.sum().persist() yield wait(y) profile = a.get_profile() assert profile['count'] assert 'sum' in str(profile) or 'random' in str(profile)
def test_statistical_profiling_2(c, s, a, b): da = pytest.importorskip("dask.array") while True: x = da.random.random(1000000, chunks=(10000, )) y = (x + x * 2) - x.sum().persist() yield wait(y) profile = a.get_profile() text = str(profile) if profile["count"] and "sum" in text and "random" in text: break