Search in sources :

Example 26 with Snapshot

use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.

the class UniformSnapshotTest method calculatesAMeanOfZeroForAnEmptySnapshot.

@Test
public void calculatesAMeanOfZeroForAnEmptySnapshot() throws Exception {
    final Snapshot emptySnapshot = new UniformSnapshot(new long[] {});
    assertThat(emptySnapshot.getMean()).isZero();
}
Also used : Snapshot(io.dropwizard.metrics.Snapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) Test(org.junit.Test)

Example 27 with Snapshot

use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.

the class UniformSnapshotTest method calculatesAMinOfZeroForAnEmptySnapshot.

@Test
public void calculatesAMinOfZeroForAnEmptySnapshot() throws Exception {
    final Snapshot emptySnapshot = new UniformSnapshot(new long[] {});
    assertThat(emptySnapshot.getMin()).isZero();
}
Also used : Snapshot(io.dropwizard.metrics.Snapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) Test(org.junit.Test)

Example 28 with Snapshot

use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.

the class UniformSnapshotTest method calculatesAStdDevOfZeroForAnEmptySnapshot.

@Test
public void calculatesAStdDevOfZeroForAnEmptySnapshot() throws Exception {
    final Snapshot emptySnapshot = new UniformSnapshot(new long[] {});
    assertThat(emptySnapshot.getStdDev()).isZero();
}
Also used : Snapshot(io.dropwizard.metrics.Snapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) Test(org.junit.Test)

Example 29 with Snapshot

use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.

the class UniformSnapshotTest method canAlsoBeCreatedFromACollectionOfLongs.

@Test
public void canAlsoBeCreatedFromACollectionOfLongs() throws Exception {
    final Snapshot other = new UniformSnapshot(asList(5L, 1L, 2L, 3L, 4L));
    assertThat(other.getValues()).containsOnly(1, 2, 3, 4, 5);
}
Also used : Snapshot(io.dropwizard.metrics.Snapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) Test(org.junit.Test)

Example 30 with Snapshot

use of io.dropwizard.metrics.Snapshot in project light-4j by networknt.

the class UniformSnapshotTest method calculatesAMaxOfZeroForAnEmptySnapshot.

@Test
public void calculatesAMaxOfZeroForAnEmptySnapshot() throws Exception {
    final Snapshot emptySnapshot = new UniformSnapshot(new long[] {});
    assertThat(emptySnapshot.getMax()).isZero();
}
Also used : Snapshot(io.dropwizard.metrics.Snapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) Test(org.junit.Test)

Aggregations

Snapshot (io.dropwizard.metrics.Snapshot)33 Test (org.junit.Test)28 WeightedSnapshot (io.dropwizard.metrics.WeightedSnapshot)8 UniformSnapshot (io.dropwizard.metrics.UniformSnapshot)6 Histogram (io.dropwizard.metrics.Histogram)4 Timer (io.dropwizard.metrics.Timer)4 InfluxDbPoint (io.dropwizard.metrics.influxdb.data.InfluxDbPoint)4 ExponentiallyDecayingReservoir (io.dropwizard.metrics.ExponentiallyDecayingReservoir)3 WeightedSample (io.dropwizard.metrics.WeightedSnapshot.WeightedSample)2 UniformReservoir (io.dropwizard.metrics.UniformReservoir)1 Before (org.junit.Before)1