Skip to content

Commit 3bc2c97

Browse files
committed
chore: linting
Signed-off-by: Vincent Biret <[email protected]>
1 parent be4f841 commit 3bc2c97

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

performance/resultsComparer/handlers/CompareCommandHandler.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ private static async Task<int> CompareResultsAsync(string existingReportPath, st
4949
{
5050
if (!newBenchmark.TryGetValue(existingBenchmarkResult.Key, out var newBenchmarkResult))
5151
{
52-
logger.LogError("No new benchmark result found for {existingBenchmarkResultKey}.", existingBenchmarkResult.Key);
52+
logger.LogError("No new benchmark result found for {ExistingBenchmarkResultKey}.", existingBenchmarkResult.Key);
5353
hasErrors = true;
5454
}
5555
foreach (var comparisonPolicy in comparisonPolicies)
5656
{
5757
if (!comparisonPolicy.Equals(existingBenchmarkResult.Value, newBenchmarkResult))
5858
{
59-
logger.LogError("Benchmark result for {existingBenchmarkResultKey} does not match the existing benchmark result. {errorMessage}", existingBenchmarkResult.Key, comparisonPolicy.GetErrorMessage(existingBenchmarkResult.Value, newBenchmarkResult));
59+
logger.LogError("Benchmark result for {ExistingBenchmarkResultKey} does not match the existing benchmark result. {ErrorMessage}", existingBenchmarkResult.Key, comparisonPolicy.GetErrorMessage(existingBenchmarkResult.Value, newBenchmarkResult));
6060
hasErrors = true;
6161
}
6262
}
@@ -67,11 +67,11 @@ private static async Task<int> CompareResultsAsync(string existingReportPath, st
6767
logger.LogError("New benchmark results found that do not exist in the existing benchmark results.");
6868
foreach (var missingKey in missingKeys)
6969
{
70-
logger.LogError("New benchmark result found: {missingKey}.", missingKey);
70+
logger.LogError("New benchmark result found: {MissingKey}.", missingKey);
7171
}
7272
hasErrors = true;
7373
}
74-
logger.LogInformation("Benchmark comparison complete. {status}", hasErrors ? "Errors found" : "No errors found");
74+
logger.LogInformation("Benchmark comparison complete. {Status}", hasErrors ? "Errors found" : "No errors found");
7575
return hasErrors ? 1 : 0;
7676
}
7777

@@ -82,13 +82,12 @@ private static async Task<int> CompareResultsAsync(string existingReportPath, st
8282
return null;
8383
}
8484
using var stream = new FileStream(targetPath, FileMode.Open, FileAccess.Read);
85-
var report = (await JsonSerializer.DeserializeAsync(stream, serializationContext.BenchmarkReport, cancellationToken: cancellationToken))
85+
var report = (await JsonSerializer.DeserializeAsync(stream, BenchmarkSourceGenerationContext.Default.BenchmarkReport, cancellationToken: cancellationToken))
8686
?? throw new InvalidOperationException($"Failed to deserialize {targetPath}.");
8787
return report.Benchmarks
8888
.Where(x => x.Memory is not null && x.Method is not null)
8989
.ToDictionary(x => x.Method!, x => x.Memory!, StringComparer.OrdinalIgnoreCase);
9090
}
91-
private static readonly BenchmarkSourceGenerationContext serializationContext = new();
9291
}
9392

9493
[JsonSerializable(typeof(BenchmarkReport))]

0 commit comments

Comments
 (0)