use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.
the class UniformSnapshotTest method calculatesAStdDevOfZeroForASingletonSnapshot.
@Test
public void calculatesAStdDevOfZeroForASingletonSnapshot() throws Exception {
final Snapshot singleItemSnapshot = new UniformSnapshot(new long[] { 1 });
assertThat(singleItemSnapshot.getStdDev()).isZero();
}
use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.
the class WeightedSnapshotTest method calculatesAStdDevOfZeroForASingletonSnapshot.
@Test
public void calculatesAStdDevOfZeroForASingletonSnapshot() throws Exception {
final Snapshot singleItemSnapshot = new WeightedSnapshot(WeightedArray(new long[] { 1 }, new double[] { 1.0 }));
assertThat(singleItemSnapshot.getStdDev()).isZero();
}
use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.
the class WeightedSnapshotTest method calculatesAStdDevOfZeroForAnEmptySnapshot.
@Test
public void calculatesAStdDevOfZeroForAnEmptySnapshot() throws Exception {
final Snapshot emptySnapshot = new WeightedSnapshot(WeightedArray(new long[] {}, new double[] {}));
assertThat(emptySnapshot.getStdDev()).isZero();
}
use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.
the class WeightedSnapshotTest method calculatesAMinOfZeroForAnEmptySnapshot.
@Test
public void calculatesAMinOfZeroForAnEmptySnapshot() throws Exception {
final Snapshot emptySnapshot = new WeightedSnapshot(WeightedArray(new long[] {}, new double[] {}));
assertThat(emptySnapshot.getMin()).isZero();
}
use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.
the class WeightedSnapshotTest method expectNoOverflowForLowWeights.
@Test
public void expectNoOverflowForLowWeights() throws Exception {
final Snapshot scatteredSnapshot = new WeightedSnapshot(WeightedArray(new long[] { 1, 2, 3 }, new double[] { Double.MIN_VALUE, Double.MIN_VALUE, Double.MIN_VALUE }));
assertThat(scatteredSnapshot.getMean()).isEqualTo(2);
}
Aggregations