From a27bc8281a9795397fa5c01445140ba6504960f7 Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 29 Jul 2025 19:04:55 -0400 Subject: Add some manual tests for aiohttp and aiofiles --- aergia/aergia.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'aergia') 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: -- cgit v1.2.3