diff --git a/src/api_client.rs b/src/api_client.rs index 58a72e69..c4a40730 100644 --- a/src/api_client.rs +++ b/src/api_client.rs @@ -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, + } +} + nest! { #[derive(Debug, Deserialize, Serialize)]* #[serde(rename_all = "camelCase")]* @@ -119,6 +127,7 @@ nest! { pub name: String, pub executor: ExecutorName, }, + pub issues: Option, pub valgrind: Option, + }>, } } diff --git a/src/queries/CompareRuns.gql b/src/queries/CompareRuns.gql index 9c9b0743..ae4ed364 100644 --- a/src/queries/CompareRuns.gql +++ b/src/queries/CompareRuns.gql @@ -17,6 +17,11 @@ query CompareRuns($owner: String!, $name: String!, $baseRunId: String!, $headRun change category status + result { + issues { + callgraphGenerationFailure + } + } } } } diff --git a/src/queries/FetchLocalRun.gql b/src/queries/FetchLocalRun.gql index 4c211062..f51aaf3b 100644 --- a/src/queries/FetchLocalRun.gql +++ b/src/queries/FetchLocalRun.gql @@ -10,6 +10,9 @@ query FetchLocalRun($owner: String!, $name: String!, $runId: String!) { executor } value + issues { + callgraphGenerationFailure + } valgrind { timeDistribution { ir diff --git a/src/upload/benchmark_display.rs b/src/upload/benchmark_display.rs index 0dbdff6d..44b06332 100644 --- a/src/upload/benchmark_display.rs +++ b/src/upload/benchmark_display.rs @@ -444,6 +444,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 @@ -461,6 +462,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 @@ -479,6 +481,7 @@ mod tests { executor: ExecutorName::WallTime, }, value: 0.150, + issues: None, valgrind: None, walltime: Some(WallTimeResult { iterations: 100.0, @@ -493,6 +496,7 @@ mod tests { executor: ExecutorName::WallTime, }, value: 0.025, + issues: None, valgrind: None, walltime: Some(WallTimeResult { iterations: 500.0, @@ -508,6 +512,7 @@ mod tests { executor: ExecutorName::Memory, }, value: 10485760.0, + issues: None, valgrind: None, walltime: None, memory: Some(MemoryResult { @@ -522,6 +527,7 @@ mod tests { executor: ExecutorName::Memory, }, value: 1048576.0, + issues: None, valgrind: None, walltime: None, memory: Some(MemoryResult { @@ -547,6 +553,7 @@ mod tests { executor: ExecutorName::Valgrind, }, value: 0.001234, // 1.23 ms + issues: None, valgrind: None, walltime: None, memory: None, @@ -565,6 +572,7 @@ mod tests { executor: ExecutorName::WallTime, }, value: 1.5, + issues: None, valgrind: None, walltime: Some(WallTimeResult { iterations: 50.0, @@ -587,6 +595,7 @@ mod tests { executor: ExecutorName::Memory, }, value: 1048576.0, + issues: None, valgrind: None, walltime: None, memory: Some(MemoryResult { diff --git a/src/upload/poll_results.rs b/src/upload/poll_results.rs index 1a0bd560..bbe5cda3 100644 --- a/src/upload/poll_results.rs +++ b/src/upload/poll_results.rs @@ -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; @@ -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{} {}", @@ -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:"); + 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(), @@ -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(),