/** * Instantiates a new statistic impl. * * @param value the value * @param executor the executor * @param historySize the history size * @param historyNanos the history nanos */ public StatisticImpl(ValueStatistic<T> value, ScheduledExecutorService executor, int historySize, long historyNanos) { super(value, executor, historySize, historyNanos); }
/** * Sets the history. * * @param historySize the history size * @param historyNanos the history nanos */ void setHistory(int historySize, long historyNanos) { minimumStatistic.setHistory(historySize, historyNanos); maximumStatistic.setHistory(historySize, historyNanos); averageStatistic.setHistory(historySize, historyNanos); }
/** * Start. */ synchronized void start() { if (!active) { source.addDerivedStatistic(latencySampler); minimumStatistic.startSampling(); maximumStatistic.startSampling(); averageStatistic.startSampling(); active = true; } }
/** * Expire. * * @param expiry the expiry * @return true, if successful */ public synchronized boolean expire(long expiry) { if (touchTimestamp < expiry) { if (active) { source.removeDerivedStatistic(latencySampler); minimumStatistic.stopSampling(); maximumStatistic.stopSampling(); averageStatistic.stopSampling(); active = false; } return true; } else { return false; } }
/** * Expire. * * @param expiry the expiry * @return true, if successful */ public synchronized boolean expire(long expiry) { if (touchTimestamp < expiry) { if (active) { source.removeDerivedStatistic(latencySampler); minimumStatistic.stopSampling(); maximumStatistic.stopSampling(); averageStatistic.stopSampling(); active = false; } return true; } else { return false; } }
/** * Start. */ synchronized void start() { if (!active) { source.addDerivedStatistic(latencySampler); minimumStatistic.startSampling(); maximumStatistic.startSampling(); averageStatistic.startSampling(); active = true; } }
/** * Sets the history. * * @param historySize the history size * @param historyNanos the history nanos */ void setHistory(int historySize, long historyNanos) { minimumStatistic.setHistory(historySize, historyNanos); maximumStatistic.setHistory(historySize, historyNanos); averageStatistic.setHistory(historySize, historyNanos); }
/** * Instantiates a new statistic impl. * * @param value the value * @param executor the executor * @param historySize the history size * @param historyNanos the history nanos */ public StatisticImpl(ValueStatistic<T> value, ScheduledExecutorService executor, int historySize, long historyNanos) { super(value, executor, historySize, historyNanos); }
/** * Expire. * * @param expiry the expiry * @return true, if successful */ public synchronized boolean expire(long expiry) { if (touchTimestamp < expiry) { if (active) { source.removeDerivedStatistic(latencySampler); minimumStatistic.stopSampling(); maximumStatistic.stopSampling(); averageStatistic.stopSampling(); active = false; } return true; } else { return false; } }
/** * Instantiates a new statistic impl. * * @param value the value * @param executor the executor * @param historySize the history size * @param historyNanos the history nanos */ public StatisticImpl(ValueStatistic<T> value, ScheduledExecutorService executor, int historySize, long historyNanos) { super(value, executor, historySize, historyNanos); }
/** * Sets the history. * * @param historySize the history size * @param historyNanos the history nanos */ void setHistory(int historySize, long historyNanos) { minimumStatistic.setHistory(historySize, historyNanos); maximumStatistic.setHistory(historySize, historyNanos); averageStatistic.setHistory(historySize, historyNanos); }
/** * Start. */ synchronized void start() { if (!active) { source.addDerivedStatistic(latencySampler); minimumStatistic.startSampling(); maximumStatistic.startSampling(); averageStatistic.startSampling(); active = true; } }