Skip to content

Commit

Permalink
fixed RequestsPerSecond property in BDN (#6867)
Browse files Browse the repository at this point in the history
had to add a null check to make sure we weren't missing reports
  • Loading branch information
Aaronontheweb authored Aug 1, 2023
1 parent 29cc42f commit 33dda22
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/benchmark/Akka.Benchmarks/Configurations/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyl
{
var benchmarkAttribute = benchmarkCase.Descriptor.WorkloadMethod.GetCustomAttribute<BenchmarkAttribute>();
var totalOperations = benchmarkAttribute?.OperationsPerInvoke ?? 1;

var report = summary[benchmarkCase];
var nsPerOperation = report.ResultStatistics.Mean;
var operationsPerSecond = 1 / (nsPerOperation / 1e9);

if (summary.HasReport(benchmarkCase))
{
var report = summary[benchmarkCase];
var nsPerOperation = report.ResultStatistics.Mean;
var operationsPerSecond = 1 / (nsPerOperation / 1e9);

return operationsPerSecond.ToString("N2"); // or format as you like
return operationsPerSecond.ToString("N2"); // or format as you like
}

return "<not found>";
}
}

Expand Down

0 comments on commit 33dda22

Please sign in to comment.