private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger( DistributingMetricTest.class );
@Test
public void testDistrbution() {
TimingMetric t = new BasicTimingMetric( "testTimer" );
MeteringMetric m = new BasicMeteringMetric( "testMeter" );
DistributingMetric dm = new DistributingMetric<>( "testDist",
map( pairOf( Conditions.all(), "testTimer" ), pairOf( Conditions.exception(), "testMeter" ) ),
t, m );
dm.addEvent( new BasicTimingEvent( 0, 1000L ) );
dm.addEvent( new BasicTimingEvent( 0, 2000L, null, null, new RuntimeException( "test ex" ) ) );
assertEquals( t.getCount(), BigInteger.valueOf( 2 ) );
assertEquals( m.getCount(), BigInteger.valueOf( 1 ) );
}