Skip to content

Commit bbb61fa

Browse files
committed
More cases, better formatting
1 parent 5733aa5 commit bbb61fa

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/SeqCli/Cli/Commands/Bench/BenchCases.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
"query": "select count(*) from stream where @Timestamp >= now() - 30d",
66
"notes": "Tests page traversal performance only; avoids data copies, serialization, and evaluation."
77
},
8+
{
9+
"id": "multiple-reductions",
10+
"query": "select count(*), sum(A), min(B), max(C) from stream where @Timestamp >= now() - 30d",
11+
"notes": "Reducer performance. Percentile is excluded because it prevents parallelization unless time-grouped."
12+
},
13+
{
14+
"id": "percentile-by-12h",
15+
"query": "select percentile(@Timestamp % 1ms, 90) from stream where @Timestamp >= now() - 30d group by @Level, time(12h)",
16+
"notes": "Common reducer/grouping combination used when monitoring performance."
17+
},
818
{
919
"id": "count-having-request-id",
1020
"query": "select count(*) from stream where RequestId is not null and @Timestamp >= now() - 30d",
@@ -21,17 +31,17 @@
2131
"notes": "Text search performance; worse on @Message than other properties because fragment pre-filtering is not used."
2232
},
2333
{
24-
"id": "count-by-level",
34+
"id": "group-by-level",
2535
"query": "select count(*) from stream where @Timestamp >= now() - 30d group by @Level",
2636
"notes": "Grouping performance, strings, small number of groups."
2737
},
2838
{
29-
"id": "count-by-millisecond",
39+
"id": "group-by-millisecond",
3040
"query": "select count(*) from stream where @Timestamp >= now() - 30d group by @Timestamp % 1ms limit 100",
3141
"notes": "Grouping performance, numbers, up to 10000 groups."
3242
},
3343
{
34-
"id": "count-by-day",
44+
"id": "group-by-12h",
3545
"query": "select count(*) from stream where @Timestamp >= now() - 30d group by time(12h)",
3646
"notes": "Time partitioning performance."
3747
},
@@ -49,6 +59,11 @@
4959
"id": "order-by-message-limit-10",
5060
"query": "select @Message from stream where @Timestamp >= now() - 30d order by @Message limit 10",
5161
"notes": "Adds character collation to limited sort."
62+
},
63+
{
64+
"id": "count-where-heavy-predicate",
65+
"query": "select count(*) from stream where (A = 1 or B = '2' or C or D <> null or length(E) > 5 or F = {f: 6} or G = '7' or H like '8%' or I > 9 or J % 10 = 0) and @Timestamp >= now() - 30d",
66+
"notes": "Tests expression evaluation performance."
5267
}
5368
]
5469
}

src/SeqCli/Cli/Commands/Bench/BenchCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected override async Task<int> Run()
125125
using (LogContext.PushProperty("Start", _range.Start))
126126
using (LogContext.PushProperty("End", _range.End))
127127
{
128-
foreach (var c in cases.Cases)
128+
foreach (var c in cases.Cases.OrderBy(c => c.Id))
129129
{
130130
var timings = new BenchCaseTimings();
131131
object? lastResult = null;
@@ -159,7 +159,7 @@ protected override async Task<int> Run()
159159
using (LogContext.PushProperty("Query", c.Query))
160160
{
161161
reportingLogger.Information(
162-
"Case {Id,-40} mean {MeanElapsed,5:N0} ms (first {FirstElapsed:N0} ms, min {MinElapsed,5:N0} ms, max {MaxElapsed,5:N0} ms, RSD {RelativeStandardDeviationElapsed,4:N2})",
162+
"Case {Id,-40} mean {MeanElapsed,5:N0} ms (first {FirstElapsed:,5N0} ms, min {MinElapsed,5:N0} ms, max {MaxElapsed,5:N0} ms, RSD {RelativeStandardDeviationElapsed,4:N2})",
163163
c.Id, timings.MeanElapsed, timings.FirstElapsed, timings.MinElapsed, timings.MaxElapsed, timings.RelativeStandardDeviationElapsed);
164164
}
165165
}

0 commit comments

Comments
 (0)