private Statistics() { _probes = new ConcurrentHashMap<Statistics.StatsType, Statistics.MinMaxAvgProbe>(); for( final StatsType item : StatsType.values() ) { _probes.put( item, new MinMaxAvgProbe() ); } }
public MinMaxAvgProbe getProbe( @Nonnull final StatsType statsType ) { return new MinMaxAvgProbe(); }
private Statistics() { _probes = new ConcurrentHashMap<Statistics.StatsType, Statistics.MinMaxAvgProbe>(); for( final StatsType item : StatsType.values() ) { _probes.put( item, new MinMaxAvgProbe() ); } }
public MinMaxAvgProbe getProbe( @Nonnull final StatsType statsType ) { return new MinMaxAvgProbe(); }
@Test public void testMinMaxAvgProbe() { final MinMaxAvgProbe cut = new MinMaxAvgProbe(); assertValues( cut, 0, 0, 0, 0 ); cut.register( 1 ); assertValues( cut, 1, 1, 1, 1 ); cut.register( 1 ); assertValues( cut, 2, 1, 1, 1 ); cut.register( 4 ); assertValues( cut, 3, 1, 4, 2 ); cut.register( 0 ); assertValues( cut, 4, 0, 4, 1.5 ); }