diff options
| author | bd <bdunahu@operationnull.com> | 2025-07-29 19:04:55 -0400 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-07-29 19:04:55 -0400 |
| commit | a27bc8281a9795397fa5c01445140ba6504960f7 (patch) | |
| tree | ebedc463cb4534412bb8395825d45ff26213779d /aergia/aergia.py | |
| parent | e27aedcea3f1daf252d99b5fee218250ae1b6d1e (diff) | |
Add some manual tests for aiohttp and aiofiles
Diffstat (limited to 'aergia/aergia.py')
| -rwxr-xr-x | aergia/aergia.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/aergia/aergia.py b/aergia/aergia.py index 56f345d..b99f06d 100755 --- a/aergia/aergia.py +++ b/aergia/aergia.py @@ -53,8 +53,6 @@ import sys import threading import time import traceback -import gc -import inspect orig_thread_join = threading.Thread.join @@ -139,7 +137,8 @@ class Aergia(object): def print_samples(): '''Pretty-print profiling results.''' if Aergia.total_samples > 0: - print(f"{'FILE':<19} {'FUNC':<30} {'PERC':<8} {'(ACTUAL -> SEC)':<10}") + print(f"{'FILE':<30} {'FUNC':<30}" + f" {'PERC':<8} {'(ACTUAL -> SEC)':<10}") for key in Aergia._sort_samples(Aergia.samples): Aergia.print_sample(key) else: @@ -254,8 +253,9 @@ class Aergia(object): def _tuple_to_string(sample): '''Given a namedtuple corresponding to a sample key, pretty-prints a frame as a function/file name and a line number.''' - filename = (sample.file if len(sample.file) <= 30 else sample.file[-30:]) - return f"{sample.file}:{sample.line}".ljust(20) + f"{sample.func:30}" + filename = \ + (sample.file if len(sample.file) <= 25 else sample.file[-25:]) + return f"{filename}:{sample.line}".ljust(30) + f"{sample.func:30}" @staticmethod def _sort_samples(sample_dict): @@ -309,10 +309,16 @@ class Aergia(object): '''Returns FALSE if filename is uninteresting to the user. Don't depend on this. It's good enough for testing.''' # FIXME Assume GuixSD. Makes filtering easy + if not filename: + return False if '/gnu/store' in filename: return False if 'site-packages' in filename: return False + if 'propcache' in filename: + return False + if '.pyx' in filename: + return False if filename[0] == '<': return False if 'aergia.py' in filename: |
