Skip to content

Commit e8216a9

Browse files
committed
---
yaml --- r: 175603 b: refs/heads/auto c: eb00913 h: refs/heads/master i: 175601: 9ad2b92 175599: 96b085a v: v3
1 parent 997e81f commit e8216a9

File tree

2 files changed

+1
-69
lines changed

2 files changed

+1
-69
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 72ae5186b586becdbefc6aed119a800a6081f00e
13+
refs/heads/auto: eb0091352d6f25c36222b3994f77c7695814956f
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libtest/lib.rs

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,6 @@ impl Clone for MetricMap {
239239
}
240240
}
241241

242-
/// Analysis of a single change in metric
243-
#[derive(Copy, PartialEq, Show)]
244-
pub struct MetricChange;
245-
246-
pub type MetricDiff = BTreeMap<String,MetricChange>;
247-
248242
// The default console test runner. It accepts the command line
249243
// arguments and a vector of test_descs.
250244
pub fn test_main(args: &[String], tests: Vec<TestDescAndFn> ) {
@@ -1166,26 +1160,6 @@ impl MetricMap {
11661160
let MetricMap(ref mut map) = *self;
11671161
map.insert(name.to_string(), m);
11681162
}
1169-
1170-
/// Attempt to "ratchet" an external metric file. This involves loading
1171-
/// metrics from a metric file (if it exists), comparing against
1172-
/// the metrics in `self` using `compare_to_old`, and rewriting the
1173-
/// file to contain the metrics in `self` if none of the
1174-
/// `MetricChange`s are `Regression`. Returns the diff as well
1175-
/// as a boolean indicating whether the ratchet succeeded.
1176-
pub fn ratchet(&self, p: &Path) -> (MetricDiff, bool) {
1177-
let diff : MetricDiff = BTreeMap::new();
1178-
let ok = diff.iter().all(|(_, v)| {
1179-
match *v {
1180-
_ => true
1181-
}
1182-
});
1183-
1184-
if ok {
1185-
self.save(p).unwrap();
1186-
}
1187-
return (diff, ok)
1188-
}
11891163
}
11901164

11911165

@@ -1594,46 +1568,4 @@ mod tests {
15941568
m1.insert_metric("in-both-want-upwards-and-improved", 1000.0, -10.0);
15951569
m2.insert_metric("in-both-want-upwards-and-improved", 2000.0, -10.0);
15961570
}
1597-
1598-
#[test]
1599-
pub fn ratchet_test() {
1600-
1601-
let dpth = TempDir::new("test-ratchet").ok().expect("missing test for ratchet");
1602-
let pth = dpth.path().join("ratchet.json");
1603-
1604-
let mut m1 = MetricMap::new();
1605-
m1.insert_metric("runtime", 1000.0, 2.0);
1606-
m1.insert_metric("throughput", 50.0, 2.0);
1607-
1608-
let mut m2 = MetricMap::new();
1609-
m2.insert_metric("runtime", 1100.0, 2.0);
1610-
m2.insert_metric("throughput", 50.0, 2.0);
1611-
1612-
m1.save(&pth).unwrap();
1613-
1614-
// Ask for a ratchet that should fail to advance.
1615-
let (diff1, ok1) = m2.ratchet(&pth);
1616-
assert_eq!(ok1, false);
1617-
assert_eq!(diff1.len(), 2);
1618-
1619-
// Check that it was not rewritten.
1620-
let m3 = MetricMap::load(&pth);
1621-
let MetricMap(m3) = m3;
1622-
assert_eq!(m3.len(), 2);
1623-
assert_eq!(*(m3.get(&"runtime".to_string()).unwrap()), Metric::new(1000.0, 2.0));
1624-
assert_eq!(*(m3.get(&"throughput".to_string()).unwrap()), Metric::new(50.0, 2.0));
1625-
1626-
// Ask for a ratchet with an explicit noise-percentage override,
1627-
// that should advance.
1628-
let (diff2, ok2) = m2.ratchet(&pth);
1629-
assert_eq!(ok2, true);
1630-
assert_eq!(diff2.len(), 2);
1631-
1632-
// Check that it was rewritten.
1633-
let m4 = MetricMap::load(&pth);
1634-
let MetricMap(m4) = m4;
1635-
assert_eq!(m4.len(), 2);
1636-
assert_eq!(*(m4.get(&"runtime".to_string()).unwrap()), Metric::new(1100.0, 2.0));
1637-
assert_eq!(*(m4.get(&"throughput".to_string()).unwrap()), Metric::new(50.0, 2.0));
1638-
}
16391571
}

0 commit comments

Comments
 (0)