Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
carterjfulcher committed Nov 1, 2023
1 parent 61c5f74 commit 767df6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="tinyprofiler",
version="0.1.6",
version="0.1.7",
description="A Profiling Library for Python",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down
7 changes: 4 additions & 3 deletions tinyprofiler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def analyze(self):
avgs = {k: v for k, v in sorted(avgs.items(), key=lambda item: sum(item[1])/len(item[1]), reverse=True)}
for unique_object, values in avgs.items():
print(f"{unique_object:<40}{sum(values)/len(values):<10.2f}{min(values):<10.2f}{max(values):<10.2f}ms")
avg = sum([sum(v) for v in avgs.values()]) / sum([len(v) for v in avgs.values()])
min = min([min(v) for v in avgs.values()])
max = max([max(v) for v in avgs.values()])
durations = [p.end_time - p.start_time for p in parents]
avg = sum(durations)/len(durations)/1000000
min = min(durations)/1000000
max = max(durations)/1000000
print(f"{'Totals':<40}{avg:<10.2f}{min:<10.2f}{max:<10.2f}ms")

# flame graph:
Expand Down

0 comments on commit 767df6b

Please sign in to comment.