Skip to content

Commit

Permalink
Merge pull request #1944 from s7tya/remove-empty-summary-graphs
Browse files Browse the repository at this point in the history
insert only summaries with specified profile when specified
  • Loading branch information
Kobzol committed Jul 11, 2024
2 parents 38854af + aac66e1 commit 8eb7b0f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions site/src/request_handlers/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,13 @@ async fn create_graphs(
.collect();

if request.benchmark.is_none() {
let summary_benchmark = create_summary(ctxt, &interpolated_responses, request.kind)?;
let request_profile = request
.profile
.as_ref()
.map(|p| p.parse::<Profile>())
.transpose()?;
let summary_benchmark =
create_summary(ctxt, &interpolated_responses, request.kind, request_profile)?;
benchmarks.insert("Summary".to_string(), summary_benchmark);
}

Expand Down Expand Up @@ -289,12 +295,16 @@ fn create_summary(
Vec<((ArtifactId, Option<f64>), IsInterpolated)>,
>],
graph_kind: GraphKind,
profile: Option<Profile>,
) -> ServerResult<HashMap<Profile, HashMap<String, graphs::Series>>> {
let mut baselines = HashMap::new();
let mut summary_benchmark = HashMap::new();
let summary_query_cases = iproduct!(
ctxt.summary_scenarios(),
vec![Profile::Check, Profile::Debug, Profile::Opt, Profile::Doc]
profile.map_or_else(
|| vec![Profile::Check, Profile::Debug, Profile::Opt, Profile::Doc],
|p| vec![p]
)
);
for (scenario, profile) in summary_query_cases {
let baseline = match baselines.entry((profile, scenario)) {
Expand Down

0 comments on commit 8eb7b0f

Please sign in to comment.