summaryrefslogtreecommitdiff
path: root/aergia
diff options
context:
space:
mode:
Diffstat (limited to 'aergia')
-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