com.alachisoft.ncache.common.caching.statistics.customcounters.RateOfCounter Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.alachisoft.ncache.common.caching.statistics.customcounters;
/**
* @author Muneeb Shahid
*
* RateOfCounter is an instantaneous counter used for calculating average operations performed in one second.
* For e.g Average data sent
*/
public class RateOfCounter extends InstantaneousCounter {
public RateOfCounter(String name, String instance) {
super(name, instance);
}
public RateOfCounter(String category, String name, String instance) {
super(category, name, instance);
}
@Override
protected void calculate(double value) {
_value += value;
}
@Override
protected void flipChanged() {
}
@Override
public void decrement() {
}
@Override
public void decrementBy(double value) {
}
@Override
public double getValue() {
super.updateIfFlipChanged();
return _lastValue;
}
@Override
public void setValue(double _value) {
this._value = _value;
}
}