Skip to content

Commit

Permalink
feat: Add Benchmark to BenchmarkBaseline.Profile
Browse files Browse the repository at this point in the history
This allows us to forward information about the benchmark down to the exporters.
  • Loading branch information
Jairon Terrero authored and CrownedPhoenix committed Dec 5, 2024
1 parent 97a55c1 commit 6ff98fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Plugins/BenchmarkTool/BenchmarkTool+Baselines.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ struct BenchmarkBaseline: Codable {
/// Represents a particular execution of a specific benchmark
/// and its set of results.
struct Profile: Codable {
var benchmark: Benchmark
var results: [BenchmarkResult]

init(results: [BenchmarkResult] = []) {
init(benchmark: Benchmark, results: [BenchmarkResult] = []) {
self.benchmark = benchmark
self.results = results
}
}
Expand Down
1 change: 1 addition & 0 deletions Plugins/BenchmarkTool/BenchmarkTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ struct BenchmarkTool: AsyncParsableCommand {

for result in results {
benchmarkResults[result.key] = BenchmarkBaseline.Profile(
benchmark: benchmark,
results: result.value
)
}
Expand Down

0 comments on commit 6ff98fa

Please sign in to comment.