This commit is contained in:
zab
2012-11-22 20:47:54 +00:00
parent 8c987fc0d2
commit 7c96044d18
2 changed files with 4 additions and 1 deletions

View File

@@ -289,6 +289,7 @@ public class Rate {
/**
* @return the average or lifetime average depending on last event count
* @since 0.9.4
*/
public synchronized double getAvgOrLifetimeAvg() {
if (getLastEventCount() > 0)
@@ -416,6 +417,7 @@ public class Rate {
/**
* @return a thread-local temp object containing computed averages.
* @since 0.9.4
*/
public RateAverages computeAverages() {
return computeAverages(RateAverages.getTemp(),false);
@@ -426,6 +428,7 @@ public class Rate {
* @param useLifetime whether the lifetime average should be used if
* there are no events.
* @return the same RateAverages object for chaining
* @since 0.9.4
*/
public synchronized RateAverages computeAverages(RateAverages out, boolean useLifetime) {
out.reset();

View File

@@ -41,7 +41,7 @@ public class RateAverages {
* if there are any events (current or last) => weighted average
* otherwise if the useLifetime parameter to Rate.computeAverages was:
* true => the lifetime average value
* false => the current average value
* false => zero
*/
public double getAverage() {
return average;