Skip to content

Commit 2b9ebe1

Browse files
Merge pull request #1519 from rust-lang/dashboard-improvements
Display two decimal places in the dashboard
2 parents af4e66a + 11cd5a3 commit 2b9ebe1

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

site/src/request_handlers/dashboard.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use collector::benchmark::{compile_benchmark_dir, get_compile_benchmarks};
12
use std::sync::Arc;
23

34
use crate::api::{dashboard, ServerResult};
@@ -74,23 +75,18 @@ pub async fn handle_dashboard(ctxt: Arc<SiteCtxt>) -> ServerResult<dashboard::Re
7475
.collect::<Vec<_>>(),
7576
);
7677

78+
let stable_benchmarks: Vec<String> =
79+
get_compile_benchmarks(&compile_benchmark_dir(), None, None)
80+
.map_err(|error| format!("Could not load benchmarks: {error:?}"))?
81+
.into_iter()
82+
.filter(|benchmark| benchmark.category().is_stable())
83+
.map(|benchmark| benchmark.name.to_string())
84+
.collect();
85+
7786
let query = selector::Query::new()
78-
// FIXME: don't hardcode the stabilized benchmarks
79-
// This list was found via:
80-
// `rg supports.stable collector/compile-benchmarks/ -tjson -c --sort path`
8187
.set(
8288
selector::Tag::Benchmark,
83-
selector::Selector::Subset(vec![
84-
"encoding",
85-
"futures",
86-
"html5ever",
87-
"inflate",
88-
"piston-image",
89-
"regex",
90-
"style-servo",
91-
"syn",
92-
"tokio-webpush-simple",
93-
]),
89+
selector::Selector::Subset(stable_benchmarks),
9490
)
9591
.set(selector::Tag::Metric, selector::Selector::One("wall-time"));
9692

@@ -120,7 +116,7 @@ pub async fn handle_dashboard(ctxt: Arc<SiteCtxt>) -> ServerResult<dashboard::Re
120116
.collect::<Vec<_>>(),
121117
)
122118
.map(|((_id, point), _interpolated)| {
123-
(point.expect("interpolated") * 10.0).round() / 10.0
119+
(point.expect("interpolated") * 100.0).round() / 100.0
124120
})
125121
.collect::<Vec<_>>();
126122

0 commit comments

Comments
 (0)