| Method from org.apache.activemq.management.TimeStatisticImpl Detail: |
public synchronized void addTime(long time) {
count++;
totalTime += time;
if (time > maxTime) {
maxTime = time;
}
if (time < minTime || minTime == 0) {
minTime = time;
}
updateSampleTime();
if (parent != null) {
parent.addTime(time);
}
}
|
protected synchronized void appendFieldDescription(StringBuffer buffer) {
buffer.append(" count: ");
buffer.append(Long.toString(count));
buffer.append(" maxTime: ");
buffer.append(Long.toString(maxTime));
buffer.append(" minTime: ");
buffer.append(Long.toString(minTime));
buffer.append(" totalTime: ");
buffer.append(Long.toString(totalTime));
buffer.append(" averageTime: ");
buffer.append(Double.toString(getAverageTime()));
buffer.append(" averageTimeExMinMax: ");
buffer.append(Double.toString(getAverageTimeExcludingMinMax()));
buffer.append(" averagePerSecond: ");
buffer.append(Double.toString(getAveragePerSecond()));
buffer.append(" averagePerSecondExMinMax: ");
buffer.append(Double.toString(getAveragePerSecondExcludingMinMax()));
super.appendFieldDescription(buffer);
}
|
public double getAveragePerSecond() {
double d = 1000;
double averageTime = getAverageTime();
if (averageTime == 0) {
return 0;
}
return d / averageTime;
}
|
public double getAveragePerSecondExcludingMinMax() {
double d = 1000;
double average = getAverageTimeExcludingMinMax();
if (average == 0) {
return 0;
}
return d / average;
}
|
public synchronized double getAverageTime() {
if (count == 0) {
return 0;
}
double d = totalTime;
return d / count;
}
|
public synchronized double getAverageTimeExcludingMinMax() {
if (count < = 2) {
return 0;
}
double d = totalTime - minTime - maxTime;
return d / (count - 2);
}
|
public synchronized long getCount() {
return count;
}
|
public long getMaxTime() {
return maxTime;
}
|
public synchronized long getMinTime() {
return minTime;
}
|
public TimeStatisticImpl getParent() {
return parent;
}
|
public synchronized long getTotalTime() {
return totalTime;
}
|
public synchronized void reset() {
if(isDoReset()) {
super.reset();
count = 0;
maxTime = 0;
minTime = 0;
totalTime = 0;
}
}
|
public void setParent(TimeStatisticImpl parent) {
this.parent = parent;
}
|