зеркало из https://github.com/mozilla/glean.git
Convert count to `i64` in DistributionData
This was what I originally tried but tests were failing locally. Travis tested and said it looked fine for him and I want to see if CI runs.
This commit is contained in:
Родитель
9ff8e143b3
Коммит
5843575f19
|
@ -53,7 +53,7 @@ class TimingDistributionMetricTypeTest {
|
|||
val snapshot = metric.testGetValue()!!
|
||||
// Check the sum
|
||||
assertTrue(snapshot.sum > 0L)
|
||||
assertEquals(snapshot.count, 3UL)
|
||||
assertEquals(snapshot.count, 3L)
|
||||
// Check that the 1L fell into the first bucket (max 1)
|
||||
// assertEquals(1L, snapshot.values[1])
|
||||
// Check that the 2L fell into the second bucket (max 2)
|
||||
|
@ -127,7 +127,7 @@ class TimingDistributionMetricTypeTest {
|
|||
val snapshot = metric.testGetValue("store2")!!
|
||||
// Check the sum
|
||||
assertTrue(snapshot.sum > 0)
|
||||
assertEquals(snapshot.count, 3UL)
|
||||
assertEquals(snapshot.count, 3L)
|
||||
// Check that the 1L fell into the first bucket
|
||||
// assertEquals(1L, snapshot.values[1])
|
||||
// Check that the 2L fell into the second bucket
|
||||
|
@ -139,7 +139,7 @@ class TimingDistributionMetricTypeTest {
|
|||
val snapshot2 = metric.testGetValue("store3")!!
|
||||
// Check the sum
|
||||
assertEquals(snapshot.sum, snapshot2.sum)
|
||||
assertEquals(snapshot2.count, 3UL)
|
||||
assertEquals(snapshot2.count, 3L)
|
||||
// Check that the 1L fell into the first bucket
|
||||
// assertEquals(1L, snapshot2.values[1])
|
||||
// Check that the 2L fell into the second bucket
|
||||
|
@ -173,7 +173,7 @@ class TimingDistributionMetricTypeTest {
|
|||
assertEquals(6L * secondsToNanos, snapshot.sum)
|
||||
|
||||
// Check that we got the right number of samples.
|
||||
assertEquals(snapshot.count, 3UL)
|
||||
assertEquals(snapshot.count, 3L)
|
||||
|
||||
// We should get a sample in 3 buckets.
|
||||
// These numbers are a bit magic, but they correspond to
|
||||
|
@ -279,7 +279,7 @@ class TimingDistributionMetricTypeTest {
|
|||
val snapshot = metric.testGetValue()!!
|
||||
// Check the sum
|
||||
assertTrue(snapshot.sum > 0L)
|
||||
assertEquals(snapshot.count, 3UL)
|
||||
assertEquals(snapshot.count, 3L)
|
||||
// Check that the 1L fell into the first bucket (max 1)
|
||||
// assertEquals(1L, snapshot.values[1])
|
||||
// Check that the 2L fell into the second bucket (max 2)
|
||||
|
@ -319,7 +319,7 @@ class TimingDistributionMetricTypeTest {
|
|||
val snapshot = metric.testGetValue()!!
|
||||
assertTrue("Should have stored some nanoseconds", snapshot.sum > 0L)
|
||||
|
||||
assertEquals(snapshot.count, 1UL)
|
||||
assertEquals(snapshot.count, 1L)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -390,7 +390,7 @@ dictionary DistributionData {
|
|||
i64 sum;
|
||||
|
||||
// The total number of entries in the distribution.
|
||||
u64 count;
|
||||
i64 count;
|
||||
};
|
||||
|
||||
// Identifier for a running timer.
|
||||
|
|
|
@ -34,7 +34,7 @@ pub(crate) fn snapshot<B: Bucketing>(hist: &Histogram<B>) -> DistributionData {
|
|||
.map(|(k, v)| (k as i64, v as i64))
|
||||
.collect(),
|
||||
sum: hist.sum() as i64,
|
||||
count: hist.count(),
|
||||
count: hist.count() as i64,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ pub(crate) fn snapshot(hist: &Histogram<Functional>) -> DistributionData {
|
|||
.map(|(k, v)| (k as i64, v as i64))
|
||||
.collect(),
|
||||
sum: hist.sum() as i64,
|
||||
count: hist.count(),
|
||||
count: hist.count() as i64,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ pub struct DistributionData {
|
|||
pub sum: i64,
|
||||
|
||||
/// The total number of entries in the distribution.
|
||||
pub count: u64,
|
||||
pub count: i64,
|
||||
}
|
||||
|
||||
/// The available metrics.
|
||||
|
|
|
@ -75,7 +75,7 @@ pub(crate) fn snapshot(hist: &Histogram<Functional>) -> DistributionData {
|
|||
.map(|(k, v)| (k as i64, v as i64))
|
||||
.collect(),
|
||||
sum: hist.sum() as i64,
|
||||
count: hist.count(),
|
||||
count: hist.count() as i64,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче