Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion reframe/frontend/reporting/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Aggregation:

AGG_REGEX = re.compile(r'(?P<op>\S+)\((?P<col>\S+)\)|(?P<op2>\S+)')
OP_REGEX = re.compile(
r'min|max|median|mean|std|first|last|sum|stats|p\d{2}'
r'min|max|median|mean|std|first|last|sum|stats|count|p\d{2}'
)
Q_REGEX = re.compile(r'p(\d{2})')

Expand Down Expand Up @@ -89,6 +89,8 @@ def _expr_from_op(col, op):
return pl.col(col).last().alias(f'{col} (last)')
elif op == 'sum':
return pl.col(col).sum().alias(f'{col} (sum)')
elif op == 'count':
return pl.col(col).count().alias(f'{col} (count)')
elif m := self.Q_REGEX.match(op):
perc = m.group(1)
if perc == '00':
Expand Down
5 changes: 4 additions & 1 deletion unittests/test_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ def test_parse_cmp_spec_period(time_period):

@pytest.fixture(params=['first', 'last', 'mean', 'median',
'min', 'max', 'std', 'stats', 'sum',
'p00', 'p01', 'p05', 'p95', 'p99'])
'p00', 'p01', 'p05', 'p95', 'p99',
'count'])
def aggregator(request):
return request.param

Expand Down Expand Up @@ -289,6 +290,8 @@ def test_parse_cmp_spec_aggregations(aggregator):
assert agg['pval (p95)'][0] == 10
elif aggregator == 'p05':
assert agg['pval (p99)'][0] == 10
elif aggregator == 'count':
assert 'pval (count)' in agg.columns

# Check variant without base period
match = parse_cmp_spec(f'now-1d:now/{aggregator}:/')
Expand Down
Loading