Skip to content

Commit 7ac9471

Browse files
committed
implement handler
1 parent 6915e68 commit 7ac9471

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

site/src/api.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ pub mod runtime_detail_graphs {
215215
pub end: Bound,
216216
pub stat: String,
217217
pub benchmark: String,
218-
pub scenario: String,
219-
pub profile: String,
220218
#[serde(deserialize_with = "vec_from_comma_separated")]
221219
pub kinds: Vec<GraphKind>,
222220
}

site/src/request_handlers/graph.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ use crate::api::{detail_graphs, detail_sections, graphs, runtime_detail_graphs,
99
use crate::db::{self, ArtifactId, Profile, Scenario};
1010
use crate::interpolate::IsInterpolated;
1111
use crate::load::SiteCtxt;
12-
use crate::selector::{CompileBenchmarkQuery, CompileTestCase, Selector, SeriesResponse};
12+
use crate::selector::{
13+
CompileBenchmarkQuery, CompileTestCase, RuntimeBenchmarkQuery, Selector, SeriesResponse,
14+
};
1315
use crate::self_profile::get_or_download_self_profile;
1416

1517
/// Returns data for before/after graphs when comparing a single test result comparison
@@ -133,13 +135,10 @@ pub async fn handle_runtime_detail_graphs(
133135
request.end,
134136
));
135137

136-
let scenario = request.scenario.parse()?;
137138
let interpolated_responses: Vec<_> = ctxt
138139
.statistic_series(
139-
CompileBenchmarkQuery::default()
140+
RuntimeBenchmarkQuery::default()
140141
.benchmark(Selector::One(request.benchmark.clone()))
141-
.profile(Selector::One(request.profile.parse()?))
142-
.scenario(Selector::One(scenario))
143142
.metric(Selector::One(request.stat.parse()?)),
144143
artifact_ids.clone(),
145144
)

site/src/selector.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ pub struct RuntimeBenchmarkQuery {
338338
}
339339

340340
impl RuntimeBenchmarkQuery {
341+
pub fn benchmark(mut self, selector: Selector<String>) -> Self {
342+
self.benchmark = selector;
343+
self
344+
}
345+
346+
pub fn metric(mut self, selector: Selector<Metric>) -> Self {
347+
self.metric = selector.map(|v| v.as_str().into());
348+
self
349+
}
350+
341351
pub fn all_for_metric(metric: Metric) -> Self {
342352
Self {
343353
benchmark: Selector::All,

0 commit comments

Comments
 (0)