Skip to content

Commit 53b39d8

Browse files
committed
Do not store metrics from self-profile runs into the DB
1 parent 9b20563 commit 53b39d8

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

collector/src/compile/execute/bencher.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ impl<'a> BenchProcessor<'a> {
9797
CodegenBackend::Cranelift => database::CodegenBackend::Cranelift,
9898
};
9999

100+
// If the gathered metrics were produced with self profile enabled, then they are not
101+
// realistic. Do not store the metrics into the DB for self-profile runs to avoid unnecessary
102+
// DB storage.
100103
if let Some(files) = stats.2 {
101104
if env::var_os("RUSTC_PERF_UPLOAD_TO_S3").is_some() {
102105
// FIXME: Record codegen backend in the self profile name
@@ -128,23 +131,23 @@ impl<'a> BenchProcessor<'a> {
128131
)
129132
.await;
130133
}
131-
}
134+
} else {
135+
let mut buf = FuturesUnordered::new();
136+
for (stat, value) in stats.0.iter() {
137+
buf.push(self.conn.record_statistic(
138+
collection,
139+
self.artifact_row_id,
140+
self.benchmark.0.as_str(),
141+
profile,
142+
scenario,
143+
backend,
144+
stat,
145+
value,
146+
));
147+
}
132148

133-
let mut buf = FuturesUnordered::new();
134-
for (stat, value) in stats.0.iter() {
135-
buf.push(self.conn.record_statistic(
136-
collection,
137-
self.artifact_row_id,
138-
self.benchmark.0.as_str(),
139-
profile,
140-
scenario,
141-
backend,
142-
stat,
143-
value,
144-
));
149+
while let Some(()) = buf.next().await {}
145150
}
146-
147-
while let Some(()) = buf.next().await {}
148151
}
149152

150153
pub async fn measure_rustc(&mut self, toolchain: &Toolchain) -> anyhow::Result<()> {

0 commit comments

Comments
 (0)