Skip to content

Commit c66a4c5

Browse files
committed
Fixed a couple of issues when validated in Python 3.9
1 parent a687b39 commit c66a4c5

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

execution_process_metrics_collector/aggregator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def draw_lollipop_chart(
422422
)
423423

424424
ax.xaxis.set_major_formatter(
425-
lambda x, pos: timedelta_noday_formatter(pd.Timedelta(x))
425+
lambda x, pos: timedelta_noday_formatter(pd.Timedelta(int(round(x))))
426426
)
427427

428428
labels = []
@@ -517,7 +517,8 @@ def metrics_aggregator(
517517

518518
with sampling_period_filename.open(mode="r", encoding="utf-8") as sF:
519519
sampling_period_seconds = float(sF.readline())
520-
sampling_period_seconds_td = pd.Timedelta(sampling_period_seconds, "s")
520+
sampling_period_milliseconds = int(round(sampling_period_seconds * 1000.0))
521+
sampling_period_td = pd.Timedelta(sampling_period_milliseconds, "ms")
521522

522523
cpu_details_filename = series_dir / CPU_DETAILS_FILENAME
523524
if not cpu_details_filename.is_file():
@@ -633,7 +634,7 @@ def metrics_aggregator(
633634
first_sample = metrics["Time"].min()
634635
node_first.append(first_sample)
635636

636-
last_sample = metrics["Time"].max() + sampling_period_seconds_td
637+
last_sample = metrics["Time"].max() + sampling_period_td
637638
node_last.append(last_sample)
638639

639640
duration = last_sample - first_sample

execution_process_metrics_collector/collector.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
Sequence,
4747
Set,
4848
Tuple,
49+
)
50+
51+
from typing_extensions import (
4952
TypeAlias,
5053
)
5154

0 commit comments

Comments
 (0)