Search in sources :

Example 1 with UniformSnapshot

use of io.dropwizard.metrics.UniformSnapshot 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();
}
Also used : Snapshot(io.dropwizard.metrics.Snapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) UniformSnapshot(io.dropwizard.metrics.UniformSnapshot) Test(org.junit.Test)

Example 2 with UniformSnapshot

use of io.dropwizard.metrics.UniformSnapshot 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 3 with UniformSnapshot

use of io.dropwizard.metrics.UniformSnapshot 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 4 with UniformSnapshot

use of io.dropwizard.metrics.UniformSnapshot 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 5 with UniformSnapshot

use of io.dropwizard.metrics.UniformSnapshot 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)

Aggregations

Snapshot (io.dropwizard.metrics.Snapshot)6 UniformSnapshot (io.dropwizard.metrics.UniformSnapshot)6 Test (org.junit.Test)6