summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-07-15 13:08:57 -0600
committerbd <bdunahu@operationnull.com>2025-07-15 13:08:57 -0600
commitc4821be0e427fd2ee0759d77e5ebb0e178563ca4 (patch)
tree0d28c8bd70e28b346bb5cfd360d468ea81e148dc
parent1b83f5f452d39e28fe3150d0d69a6b2bfdcffc9b (diff)
Do not calculate total samples
-rwxr-xr-xaergia12
1 files changed, 3 insertions, 9 deletions
diff --git a/aergia b/aergia
index 6b78c7f..2809d37 100755
--- a/aergia
+++ b/aergia
@@ -102,7 +102,7 @@ class Aergia(object):
Turns on asyncio debug mode and sets up our signals.
Debug mode must be on by default to avoid losing samples.
- Debug mode is required to view the current future being waited on
+ Debug mode is required to view the current coroutine being waited on
in `Aergia.get_idle_task_frames'. The TimerHandler object otherwise
does not keep track of a _source_traceback.
'''
@@ -115,7 +115,6 @@ class Aergia(object):
Aergia.last_signal_time = Aergia.gettime()
def stop():
- os.environ["PYTHONASYNCIODEBUG"] = "0"
Aergia.disable_signals()
Aergia.print_samples()
@@ -135,7 +134,7 @@ class Aergia(object):
'''Pretty-print a single sample.'''
sig_intv = Aergia.signal_interval
value = Aergia.samples[key]
- print(f"{key} :\t{value / Aergia.total_samples:.3f}%"
+ print(f"{key} :\t\t{value * 100 / Aergia.total_samples:.3f}%"
f"\t({value:.3f} ->"
f" {value*sig_intv:.6f} seconds)")
@@ -145,15 +144,10 @@ class Aergia(object):
@staticmethod
def cpu_signal_handler(sig, frame):
- sig_intv = Aergia.signal_interval
- elapsed_since_last_signal = Aergia.gettime() - \
- Aergia.last_signal_time
keys = Aergia.compute_frames_to_record()
-
for key in keys:
Aergia.samples[Aergia.frame_to_string(key)] += 1
- Aergia.total_samples += elapsed_since_last_signal / \
- sig_intv
+ Aergia.total_samples += 1
Aergia.last_signal_time = Aergia.gettime()
@staticmethod