Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowt authored Nov 16, 2023
1 parent ca93bd3 commit 533694f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions austin/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,14 @@ def parse(metrics: str, metric_type: Optional[MetricType] = None) -> List["Metri
ms = [int(_) for _ in metrics.split(",")]
if len(ms) == 3:
return [
Metric(MetricType.TIME, ms[0] if ms[1] == 0 else 0), # cpu time
Metric(MetricType.TIME, ms[0]), # wall time
Metric(MetricType.MEMORY, ms[2] if ms[2] >= 0 else 0), # memory allocation
Metric(MetricType.MEMORY, -ms[2] if ms[2] < 0 else 0), # memory deallocation
# CPU time
Metric(MetricType.TIME, ms[0] if ms[1] == 0 else 0),
# Wall time
Metric(MetricType.TIME, ms[0]),
# Memory allocation
Metric(MetricType.MEMORY, ms[2] if ms[2] >= 0 else 0),
# Memory deallocation
Metric(MetricType.MEMORY, -ms[2] if ms[2] < 0 else 0),
]
elif len(ms) != 1:
raise ValueError()
Expand Down

0 comments on commit 533694f

Please sign in to comment.