diff options
| author | bd <bdunahu@operationnull.com> | 2025-07-27 16:00:13 -0600 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-07-27 16:00:13 -0600 |
| commit | 61b9858e52c71f9b04452d09a350e5f3a0d26d28 (patch) | |
| tree | 1d5e6ef0cdb4759e1b3fea56c3f927e8e5d4671a /t | |
| parent | 2307761116ce849f45fe92d1e08c647a824a2273 (diff) | |
Partial solution to tracing all lines (coroutines calling methods)
Diffstat (limited to 't')
| -rw-r--r-- | t/test_yappi_adaptations.py | 1 | ||||
| -rw-r--r-- | t/utils.py | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/t/test_yappi_adaptations.py b/t/test_yappi_adaptations.py index 7f034ef..a8b4212 100644 --- a/t/test_yappi_adaptations.py +++ b/t/test_yappi_adaptations.py @@ -15,6 +15,7 @@ class YappiTests(utils.AergiaUnitTestCase): if n <= 0: return await asyncio.sleep(delay) + utils.burn_cpu(0.1) await a(n - 1) await a(n - 2) @@ -1,5 +1,6 @@ from aergia.aergia import Aergia import yappi +import time import unittest @@ -63,3 +64,16 @@ class AergiaUnitTestCase(unittest.TestCase): for s in stats: if s.name == func_name: return s.ttot + + +def burn_cpu(sec): + t0 = Aergia._gettime() + elapsed = 0 + while (elapsed < sec): + for _ in range(1000): + pass + elapsed = Aergia._gettime() - t0 + + +def burn_io(sec): + time.sleep(sec) |
