Skip to content

Commit 48b95b6

Browse files
committed
Added cases hash and server to bench report
1 parent dba0c62 commit 48b95b6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ namespace SeqCli.Cli.Commands;
2222
*/
2323
class BenchCasesCollection
2424
{
25+
// An identifier for the particular cases file
26+
public int CasesHash = 0;
2527
public IList<BenchCase> Cases = new List<BenchCase>();
2628
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,8 @@ protected override async Task<int> Run()
153153
using (LogContext.PushProperty("Query", c.Query))
154154
{
155155
reportingLogger.Information(
156-
"Bench run {BenchRunId} for query {Id}: mean {MeanElapsed:N0} ms with relative dispersion {RelativeStandardDeviationElapsed:N2}",
157-
runId, c.Id,
158-
timings.MeanElapsed,
159-
timings.RelativeStandardDeviationElapsed);
156+
"Bench run {Cases}/{RunId} against {Server} for query {Id}: mean {MeanElapsed:N0} ms with relative dispersion {RelativeStandardDeviationElapsed:N2}",
157+
cases.CasesHash, runId, _reportingServerUrl, c.Id, timings.MeanElapsed, timings.RelativeStandardDeviationElapsed);
160158
}
161159
}
162160

@@ -198,6 +196,8 @@ static BenchCasesCollection ReadCases(string filename)
198196
var casesFile = JsonConvert.DeserializeObject<BenchCasesCollection>(casesString)
199197
?? new BenchCasesCollection();
200198

199+
casesFile.CasesHash = casesString.GetHashCode(); // not consistent across framework versions, but that's OK
200+
201201
if (casesFile.Cases.Select(c => c.Id).Distinct().Count() != casesFile.Cases.Count)
202202
{
203203
throw new Exception($"Cases file {filename} contains a duplicate id");

0 commit comments

Comments
 (0)