@Test public void testEmptyLatestValue() { MockedTime time = new MockedTime(); EventType type = EventType.THREAD_MAX_ACTIVE; NumerusRollingNumber counter = new NumerusRollingNumber(EventType.BOOTSTRAP, time, 200, 10); assertEquals(0, counter.getValueOfLatestBucket(type)); }
public long getValueOfLatestBucket(NumerusRollingNumberEvent type) { Bucket lastBucket = getCurrentBucket(); if (lastBucket == null) return 0; return lastBucket.get(type); }
NumerusRollingNumber { public long getValueOfLatestBucket(NumerusRollingNumberEvent type) { Bucket lastBucket = getCurrentBucket(); if (lastBucket == null) return 0; return lastBucket.get(type); } }
NumerusRollingNumber { public long getValueOfLatestBucket(NumerusRollingNumberEvent type) { Bucket lastBucket = getCurrentBucket(); if (lastBucket == null) return 0; return lastBucket.get(type); } NumerusRollingNumber(NumerusRollingNumberEvent events, NumerusProperty<Integer> timeInMilliseconds, NumerusProperty<Integer> numberOfBuckets);   NumerusRollingNumber(NumerusRollingNumberEvent events, Time time, int timeInMilliseconds, int numberOfBuckets); private  NumerusRollingNumber(NumerusRollingNumberEvent events, Time time, NumerusProperty<Integer> timeInMilliseconds, NumerusProperty<Integer> numberOfBuckets); }
NumerusRollingNumber { public long getValueOfLatestBucket(NumerusRollingNumberEvent type) { Bucket lastBucket = getCurrentBucket(); if (lastBucket == null) return 0; return lastBucket.get(type); } NumerusRollingNumber(NumerusRollingNumberEvent events, NumerusProperty<Integer> timeInMilliseconds, NumerusProperty<Integer> numberOfBuckets);   NumerusRollingNumber(NumerusRollingNumberEvent events, Time time, int timeInMilliseconds, int numberOfBuckets); private  NumerusRollingNumber(NumerusRollingNumberEvent events, Time time, NumerusProperty<Integer> timeInMilliseconds, NumerusProperty<Integer> numberOfBuckets); void increment(NumerusRollingNumberEvent type, Boolean doNotBlock); void increment(NumerusRollingNumberEvent type); void add(NumerusRollingNumberEvent type, long value); void updateRollingMax(NumerusRollingNumberEvent type, long value); void reset(); long getCumulativeSum(NumerusRollingNumberEvent type); long getRollingSum(NumerusRollingNumberEvent type, Boolean doNotBlock); long getRollingSum(NumerusRollingNumberEvent type); long getValueOfLatestBucket(NumerusRollingNumberEvent type); long[] getValues(NumerusRollingNumberEvent type); long getRollingMaxValue(NumerusRollingNumberEvent type); }
NumerusRollingNumber { public long getValueOfLatestBucket(NumerusRollingNumberEvent type) { Bucket lastBucket = getCurrentBucket(); if (lastBucket == null) return 0; return lastBucket.get(type); } NumerusRollingNumber(NumerusRollingNumberEvent events, NumerusProperty<Integer> timeInMilliseconds, NumerusProperty<Integer> numberOfBuckets);   NumerusRollingNumber(NumerusRollingNumberEvent events, Time time, int timeInMilliseconds, int numberOfBuckets); private  NumerusRollingNumber(NumerusRollingNumberEvent events, Time time, NumerusProperty<Integer> timeInMilliseconds, NumerusProperty<Integer> numberOfBuckets); void increment(NumerusRollingNumberEvent type, Boolean doNotBlock); void increment(NumerusRollingNumberEvent type); void add(NumerusRollingNumberEvent type, long value); void updateRollingMax(NumerusRollingNumberEvent type, long value); void reset(); long getCumulativeSum(NumerusRollingNumberEvent type); long getRollingSum(NumerusRollingNumberEvent type, Boolean doNotBlock); long getRollingSum(NumerusRollingNumberEvent type); long getValueOfLatestBucket(NumerusRollingNumberEvent type); long[] getValues(NumerusRollingNumberEvent type); long getRollingMaxValue(NumerusRollingNumberEvent type);  }