-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathpoll_results.rs
More file actions
35 lines (29 loc) · 1 KB
/
poll_results.rs
File metadata and controls
35 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use console::style;
use crate::api_client::CodSpeedAPIClient;
use crate::cli::run::helpers::benchmark_display::{build_benchmark_table, build_detailed_summary};
use crate::prelude::*;
use crate::upload::{UploadResult, poll_run_report};
#[allow(clippy::borrowed_box)]
pub async fn poll_results(
api_client: &CodSpeedAPIClient,
upload_result: &UploadResult,
) -> Result<()> {
let response = poll_run_report(api_client, upload_result).await?;
if !response.run.results.is_empty() {
end_group!();
start_group!("Benchmark results");
if response.run.results.len() == 1 {
let summary = build_detailed_summary(&response.run.results[0]);
info!("\n{summary}");
} else {
let table = build_benchmark_table(&response.run.results);
info!("\n{table}");
}
info!(
"\n{} {}",
style("View full report:").dim(),
style(response.run.url).blue().bold().underlined()
);
}
Ok(())
}