Skip to content

Commit 9caeef9

Browse files
bors[bot]d2weber
andauthored
Merge #8042
8042: Add perf_revision to benchmark results r=lnicola a=d2weber I gave it a try to add the hash as described in #8031 Feel free to tell me if there is something I could improve. Co-authored-by: Douglas Weber <[email protected]>
2 parents 9375207 + 81a2eaa commit 9caeef9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

xtask/src/metrics.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ impl flags::Metrics {
2626
}
2727
{
2828
let _d = pushd("./target/rustc-perf")?;
29-
cmd!("git reset --hard c52ee623e231e7690a93be88d943016968c1036b").run()?;
29+
let revision = &metrics.perf_revision;
30+
cmd!("git reset --hard {revision}").run()?;
3031
}
3132

3233
let _env = pushenv("RA_METRICS", "1");
@@ -108,6 +109,7 @@ struct Metrics {
108109
host: Host,
109110
timestamp: SystemTime,
110111
revision: String,
112+
perf_revision: String,
111113
metrics: BTreeMap<String, (u64, Unit)>,
112114
}
113115

@@ -123,7 +125,8 @@ impl Metrics {
123125
let host = Host::new()?;
124126
let timestamp = SystemTime::now();
125127
let revision = cmd!("git rev-parse HEAD").read()?;
126-
Ok(Metrics { host, timestamp, revision, metrics: BTreeMap::new() })
128+
let perf_revision = "c52ee623e231e7690a93be88d943016968c1036b".into();
129+
Ok(Metrics { host, timestamp, revision, perf_revision, metrics: BTreeMap::new() })
127130
}
128131

129132
fn report(&mut self, name: &str, value: u64, unit: Unit) {
@@ -141,6 +144,7 @@ impl Metrics {
141144
let timestamp = self.timestamp.duration_since(UNIX_EPOCH).unwrap();
142145
obj.number("timestamp", timestamp.as_secs() as f64);
143146
obj.string("revision", &self.revision);
147+
obj.string("perf_revision", &self.perf_revision);
144148
let mut metrics = obj.object("metrics");
145149
for (k, (value, unit)) in &self.metrics {
146150
metrics.array(k).number(*value as f64).string(unit);

0 commit comments

Comments
 (0)