1 4 package com.tc.stats.counter.sampled; 5 6 9 public class SampledCounterConfig { 10 private final int intervalSecs; 11 private final int historySize; 12 private final boolean isReset; 13 private final long initialValue; 14 15 22 public SampledCounterConfig(int intervalSecs, int historySize, boolean isResetOnSample, long initialValue) { 23 if (intervalSecs < 1) { throw new IllegalArgumentException ("Interval (" + intervalSecs 24 + ") must be greater than or equal to 1"); } 25 if (historySize < 1) { throw new IllegalArgumentException ("History size (" + historySize 26 + ") must be greater than or equal to 1"); } 27 28 this.intervalSecs = intervalSecs; 29 this.historySize = historySize; 30 this.isReset = isResetOnSample; 31 this.initialValue = initialValue; 32 } 33 34 public int getHistorySize() { 35 return historySize; 36 } 37 38 public int getIntervalSecs() { 39 return intervalSecs; 40 } 41 42 public boolean isResetOnSample() { 43 return this.isReset; 44 } 45 46 public long getInitialValue() { 47 return this.initialValue; 48 } 49 50 } | Popular Tags |