Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ where
s.parse().map_err(de::Error::custom)
}

nest! {
#[derive(Debug, Deserialize, Serialize)]*
#[serde(rename_all = "camelCase")]*
pub struct BenchmarkIssues {
pub callgraph_generation_failure: Option<String>,
}
}

nest! {
#[derive(Debug, Deserialize, Serialize)]*
#[serde(rename_all = "camelCase")]*
Expand All @@ -119,6 +127,7 @@ nest! {
pub name: String,
pub executor: ExecutorName,
},
pub issues: Option<BenchmarkIssues>,
pub valgrind: Option<pub struct ValgrindResult {
pub time_distribution: Option<pub struct TimeDistribution {
pub ir: f64,
Expand Down Expand Up @@ -216,6 +225,9 @@ nest! {
pub name: String,
pub executor: ExecutorName,
},
pub result: Option<pub struct CompareRunsBenchmarkResultDetail {
pub issues: Option<BenchmarkIssues>,
}>,
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/queries/CompareRuns.gql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ query CompareRuns($owner: String!, $name: String!, $baseRunId: String!, $headRun
change
category
status
result {
issues {
callgraphGenerationFailure
}
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/queries/FetchLocalRun.gql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ query FetchLocalRun($owner: String!, $name: String!, $runId: String!) {
executor
}
value
issues {
callgraphGenerationFailure
}
valgrind {
timeDistribution {
ir
Expand Down
9 changes: 9 additions & 0 deletions src/upload/benchmark_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ mod tests {
executor: ExecutorName::Valgrind,
},
value: 0.001234,
issues: None,
valgrind: Some(ValgrindResult {
time_distribution: Some(TimeDistribution {
ir: 0.001048900, // 85% of 0.001234
Expand All @@ -458,6 +459,7 @@ mod tests {
executor: ExecutorName::Valgrind,
},
value: 0.002567,
issues: None,
valgrind: Some(ValgrindResult {
time_distribution: Some(TimeDistribution {
ir: 0.001796900, // 70% of 0.002567
Expand All @@ -476,6 +478,7 @@ mod tests {
executor: ExecutorName::WallTime,
},
value: 0.150,
issues: None,
valgrind: None,
walltime: Some(WallTimeResult {
iterations: 100.0,
Expand All @@ -490,6 +493,7 @@ mod tests {
executor: ExecutorName::WallTime,
},
value: 0.025,
issues: None,
valgrind: None,
walltime: Some(WallTimeResult {
iterations: 500.0,
Expand All @@ -505,6 +509,7 @@ mod tests {
executor: ExecutorName::Memory,
},
value: 10485760.0,
issues: None,
valgrind: None,
walltime: None,
memory: Some(MemoryResult {
Expand All @@ -519,6 +524,7 @@ mod tests {
executor: ExecutorName::Memory,
},
value: 1048576.0,
issues: None,
valgrind: None,
walltime: None,
memory: Some(MemoryResult {
Expand All @@ -544,6 +550,7 @@ mod tests {
executor: ExecutorName::Valgrind,
},
value: 0.001234, // 1.23 ms
issues: None,
valgrind: None,
walltime: None,
memory: None,
Expand All @@ -562,6 +569,7 @@ mod tests {
executor: ExecutorName::WallTime,
},
value: 1.5,
issues: None,
valgrind: None,
walltime: Some(WallTimeResult {
iterations: 50.0,
Expand All @@ -584,6 +592,7 @@ mod tests {
executor: ExecutorName::Memory,
},
value: 1048576.0,
issues: None,
valgrind: None,
walltime: None,
memory: Some(MemoryResult {
Expand Down
41 changes: 40 additions & 1 deletion src/upload/poll_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::api_client::{
FetchLocalRunResponse, FetchLocalRunVars, RunStatus,
};
use crate::local_logger::icons::Icon;
use crate::local_logger::{start_spinner, stop_spinner};
use crate::local_logger::{IS_TTY, start_spinner, stop_spinner};
use crate::prelude::*;

use super::UploadResult;
Expand Down Expand Up @@ -192,6 +192,19 @@ async fn display_single_run_results(
}
}

let failed: Vec<&str> = response
.run
.results
.iter()
.filter_map(|r| {
r.issues
.as_ref()
.and_then(|i| i.callgraph_generation_failure.as_ref())
.map(|_| r.benchmark.name.as_str())
})
.collect();
warn_callgraph_failures(&failed);

let run_id = &upload_result.run_id;
info!(
"\n{} {}",
Expand All @@ -204,7 +217,20 @@ async fn display_single_run_results(
Ok(())
}

fn warn_callgraph_failures(names: &[&str]) {
if names.is_empty() {
return;
}
warn!("We were unable to generate profiling data for the following benchmarks:");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also print mitigations here? e.g. "try running the benchmark again" or give specific feedback based on the error. Otherwise agents might try random things that will not work

for name in names {
warn!(" - {name}");
}
}

fn show_comparison_suggestion(run_id: &str) {
if !*IS_TTY {
return;
}
info!(
"\n{} {}",
style("To compare future runs against this one, use:").dim(),
Expand Down Expand Up @@ -269,6 +295,19 @@ async fn display_comparison_results(
}
}

let failed: Vec<&str> = comparison
.result_comparisons
.iter()
.filter_map(|r| {
r.result
.as_ref()
.and_then(|res| res.issues.as_ref())
.and_then(|i| i.callgraph_generation_failure.as_ref())
.map(|_| r.benchmark.name.as_str())
})
.collect();
warn_callgraph_failures(&failed);

info!(
"\n{} {}",
style("View comparison report:").dim(),
Expand Down
Loading