| Method from org.apache.activemq.management.CountStatisticImpl Detail: |
public void add(long amount) {
if (isEnabled()) {
counter.addAndGet(amount);
updateSampleTime();
if (parent != null) {
parent.add(amount);
}
}
}
|
protected void appendFieldDescription(StringBuffer buffer) {
buffer.append(" count: ");
buffer.append(Long.toString(counter.get()));
super.appendFieldDescription(buffer);
}
|
public void decrement() {
if (isEnabled()) {
counter.decrementAndGet();
updateSampleTime();
if (parent != null) {
parent.decrement();
}
}
}
|
public long getCount() {
return counter.get();
}
|
public double getFrequency() {
double count = counter.get();
double time = System.currentTimeMillis() - getStartTime();
return count * 1000.0 / time;
}
|
public CountStatisticImpl getParent() {
return parent;
}
|
public double getPeriod() {
double count = counter.get();
if (count == 0) {
return 0;
}
double time = System.currentTimeMillis() - getStartTime();
return time / (count * 1000.0);
}
|
public void increment() {
if (isEnabled()) {
counter.incrementAndGet();
updateSampleTime();
if (parent != null) {
parent.increment();
}
}
}
|
public void reset() {
if (isDoReset()) {
super.reset();
counter.set(0);
}
}
|
public void setCount(long count) {
if (isEnabled()) {
counter.set(count);
}
}
|
public void setParent(CountStatisticImpl parent) {
this.parent = parent;
}
|
public void subtract(long amount) {
if (isEnabled()) {
counter.addAndGet(-amount);
updateSampleTime();
if (parent != null) {
parent.subtract(amount);
}
}
}
|