Skip to content

Commit 337c51e

Browse files
committed
fix bugs
1 parent ab29ffc commit 337c51e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

devops/actions/run-tests/benchmark/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ inputs:
1717
runs:
1818
using: "composite"
1919
steps:
20+
- name: (Test) aggregate benchmark results and produce historical average
21+
if: always()
22+
uses: ./devops/actions/benchmarking/aggregate
23+
with:
24+
cutoff_timestamp: 20240101_000000
25+
env:
26+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
2027
- name: Run compute-benchmarks
2128
shell: bash
2229
run: |
@@ -60,10 +67,3 @@ runs:
6067
with:
6168
name: Compute-benchmark run ${{ github.run_id }} (${{ runner.name }})
6269
path: ./artifact
63-
- name: (Test) aggregate benchmark results and produce historical average
64-
if: always()
65-
uses: ./devops/actions/benchmarking/aggregate
66-
with:
67-
cutoff_timestamp: 20240101_000000
68-
env:
69-
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

devops/scripts/benchmarking/aggregate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import statistics
66
from common import Validate, SanitizedConfig
77
from abc import ABC, abstractmethod
8-
8+
import os
99

1010
class Aggregator(ABC):
1111
"""
@@ -52,7 +52,7 @@ def get_type() -> str:
5252
def add(self, n: float):
5353
self.elements.append(n)
5454

55-
def get_median(self) -> float:
55+
def get_avg(self) -> float:
5656
return statistics.median(self.elements)
5757

5858

@@ -91,7 +91,7 @@ def add(self, n: float):
9191
elif len(self.maxheap_smaller) < len(self.minheap_larger):
9292
heapq.heappush(self.maxheap_smaller, -heapq.heappop(self.minheap_larger))
9393

94-
def get_median(self) -> float:
94+
def get_avg(self) -> float:
9595
if len(self.maxheap_smaller) == len(self.minheap_larger):
9696
# Equal number of elements smaller and larger than "median":
9797
# thus, there are two median values. The median would then become
@@ -163,9 +163,9 @@ def csv_samples() -> list[str]:
163163
writer.writeheader()
164164
for test in samples_aggregate:
165165
writer.writerow(
166-
{"TestCase": test_case}
166+
{"TestCase": test}
167167
| {
168-
metric: samples_aggregate[test][metric].get_median()
168+
metric: samples_aggregate[test][metric].get_avg()
169169
for metric in SanitizedConfig.METRICS_TOLERANCES
170170
}
171171
)

0 commit comments

Comments
 (0)