Skip to content

Commit 407b406

Browse files
Polish self_profile errors and logging
1 parent 5df7d0a commit 407b406

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

site/src/request_handlers/self_profile.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ fn sort_self_profile(
257257
async fn get_self_profile_raw_data(url: &str) -> Result<Vec<u8>, Response> {
258258
log::trace!("downloading {}", url);
259259

260+
let start = Instant::now();
260261
let resp = match reqwest::get(url).await {
261262
Ok(r) => r,
262263
Err(e) => {
@@ -283,6 +284,12 @@ async fn get_self_profile_raw_data(url: &str) -> Result<Vec<u8>, Response> {
283284
}
284285
};
285286

287+
log::trace!(
288+
"downloaded {} bytes in {:?}",
289+
compressed.len(),
290+
start.elapsed()
291+
);
292+
286293
let mut data = Vec::new();
287294

288295
match snap::read::FrameDecoder::new(compressed.reader()).read_to_end(&mut data) {
@@ -462,7 +469,7 @@ pub async fn handle_self_profile_raw(
462469
let aids_and_cids = conn
463470
.list_self_profile(
464471
ArtifactId::Commit(database::Commit {
465-
sha: body.commit,
472+
sha: body.commit.clone(),
466473
date: database::Date::empty(),
467474
}),
468475
bench_name,
@@ -473,7 +480,7 @@ pub async fn handle_self_profile_raw(
473480
let (aid, first_cid) = aids_and_cids
474481
.first()
475482
.copied()
476-
.ok_or_else(|| format!("No results for this commit"))?;
483+
.ok_or_else(|| format!("No results for {}", body.commit))?;
477484

478485
let cid = match body.cid {
479486
Some(cid) => {

0 commit comments

Comments
 (0)