Skip to content

Commit 9b557fa

Browse files
authored
Merge pull request #2320 from Kobzol/detailed-graph-backend
Correctly pass backend when computing benchmark detail graph
2 parents 44791cc + cc3a53e commit 9b557fa

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

database/src/selector.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ impl CompileBenchmarkQuery {
212212
self
213213
}
214214

215+
pub fn backend(mut self, selector: Selector<CodegenBackend>) -> Self {
216+
self.backend = selector;
217+
self
218+
}
219+
215220
pub fn metric(mut self, selector: Selector<Metric>) -> Self {
216221
self.metric = selector.map(|v| v.as_str().into());
217222
self

site/frontend/src/pages/compare/compile/table/benchmark-detail-graph.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function createGraphsSelector(): CompileDetailGraphsSelector {
3838
benchmark: props.testCase.benchmark,
3939
profile: props.testCase.profile,
4040
scenario: props.testCase.scenario,
41+
backend: props.testCase.backend,
4142
stat: props.metric,
4243
start,
4344
end,

site/frontend/src/pages/compare/compile/table/detail-resolver.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface CompileDetailGraphsSelector {
1313
benchmark: string;
1414
scenario: string;
1515
profile: string;
16+
backend: string;
1617
kinds: GraphKind[];
1718
}
1819

@@ -62,7 +63,7 @@ export const COMPILE_DETAIL_GRAPHS_RESOLVER: CachedDataLoader<
6263
CompileDetailGraphs
6364
> = new CachedDataLoader(
6465
(key: CompileDetailGraphsSelector) =>
65-
`${key.benchmark};${key.profile};${key.scenario};${key.start};${key.end};${key.stat};${key.kinds}`,
66+
`${key.benchmark};${key.profile};${key.scenario};${key.backend};${key.start};${key.end};${key.stat};${key.kinds}`,
6667
loadGraphsDetail
6768
);
6869

@@ -76,6 +77,7 @@ async function loadGraphsDetail(
7677
benchmark: selector.benchmark,
7778
scenario: selector.scenario,
7879
profile: selector.profile,
80+
backend: selector.backend,
7981
kinds: selector.kinds.join(","),
8082
};
8183
return await getJson<CompileDetailGraphs>(
@@ -89,7 +91,7 @@ export const COMPILE_DETAIL_SECTIONS_RESOLVER: CachedDataLoader<
8991
CompileDetailSectionsSelector,
9092
CompileDetailSections
9193
> = new CachedDataLoader(
92-
(key: CompileDetailGraphsSelector) =>
94+
(key: CompileDetailSectionsSelector) =>
9395
`${key.benchmark};${key.profile};${key.scenario};${key.start};${key.end}`,
9496
loadSectionsDetail
9597
);

site/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ pub mod detail_graphs {
158158
pub benchmark: String,
159159
pub scenario: String,
160160
pub profile: String,
161+
pub backend: String,
161162
#[serde(deserialize_with = "vec_from_comma_separated")]
162163
pub kinds: Vec<GraphKind>,
163164
}

site/src/request_handlers/graph.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub async fn handle_compile_detail_graphs(
3636
.benchmark(Selector::One(request.benchmark.clone()))
3737
.profile(Selector::One(request.profile.parse()?))
3838
.scenario(Selector::One(scenario))
39+
.backend(Selector::One(request.backend.parse()?))
3940
.metric(Selector::One(request.stat.parse()?)),
4041
artifact_ids.clone(),
4142
)

0 commit comments

Comments
 (0)