Skip to content

Commit 060b71b

Browse files
authored
Merge pull request #1809 from Kobzol/fix-sections-range
Fix artifact querying for the sections detail
2 parents dc7deb4 + cfe9549 commit 060b71b

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

collector/src/compile/execute/bencher.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ impl<'a> Processor for BenchProcessor<'a> {
272272
}
273273

274274
/// Uploads self-profile results to S3
275-
struct SelfProfileS3Upload(std::process::Child, tempfile::NamedTempFile);
275+
struct SelfProfileS3Upload(
276+
std::process::Child,
277+
// This field is used only for its Drop impl
278+
#[allow(unused)] tempfile::NamedTempFile,
279+
);
276280

277281
impl SelfProfileS3Upload {
278282
fn new(

site/src/request_handlers/graph.rs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,47 +66,49 @@ pub async fn handle_compile_detail_sections(
6666
) -> ServerResult<detail_sections::Response> {
6767
log::info!("handle_compile_detail_sections({:?})", request);
6868

69-
let artifact_ids = Arc::new(master_artifact_ids_for_range(
70-
&ctxt,
71-
request.start,
72-
request.end,
73-
));
69+
let start_artifact = ctxt
70+
.artifact_id_for_bound(request.start.clone(), true)
71+
.ok_or(format!(
72+
"could not find start commit for bound {:?}",
73+
request.start
74+
))?;
75+
let end_artifact = ctxt
76+
.artifact_id_for_bound(request.end.clone(), false)
77+
.ok_or(format!(
78+
"could not find end commit for bound {:?}",
79+
request.end
80+
))?;
7481

7582
let scenario = request.scenario.parse()?;
7683

7784
async fn calculate_sections(
7885
ctxt: &SiteCtxt,
79-
aid: Option<&ArtifactId>,
86+
aid: ArtifactId,
8087
benchmark: &str,
8188
profile: &str,
8289
scenario: Scenario,
8390
) -> Option<CompilationSections> {
84-
match aid {
85-
Some(aid) => {
86-
get_or_download_self_profile(ctxt, aid.clone(), benchmark, profile, scenario, None)
87-
.await
88-
.ok()
89-
.map(|profile| CompilationSections {
90-
sections: profile.compilation_sections,
91-
})
92-
}
93-
None => None,
94-
}
91+
get_or_download_self_profile(ctxt, aid, benchmark, profile, scenario, None)
92+
.await
93+
.ok()
94+
.map(|profile| CompilationSections {
95+
sections: profile.compilation_sections,
96+
})
9597
}
9698

9799
// Doc queries are not split into the classic frontend/backend/linker parts.
98100
let (before, after) = if request.profile != "doc" {
99101
tokio::join!(
100102
calculate_sections(
101103
&ctxt,
102-
artifact_ids.get(0),
104+
start_artifact,
103105
&request.benchmark,
104106
&request.profile,
105107
scenario,
106108
),
107109
calculate_sections(
108110
&ctxt,
109-
artifact_ids.get(1),
111+
end_artifact,
110112
&request.benchmark,
111113
&request.profile,
112114
scenario,

0 commit comments

Comments
 (0)