ehcache

net.sf.ehcache.util.ratestatistics
Class UnlockedRateStatistic

java.lang.Object
  extended by net.sf.ehcache.util.ratestatistics.UnlockedRateStatistic
All Implemented Interfaces:
RateStatistic

public class UnlockedRateStatistic
extends Object

A lightweight non-thread-safe rate statistic implementation.

Author:
Chris Dennis

Constructor Summary
UnlockedRateStatistic(long averagePeriod, TimeUnit unit)
          Create an UnlockedRateStatistic instance with the given average period.
 
Method Summary
 void event()
          Fired to record the occurrence of a monitored event.
 long getCount()
          Returns the total number of events that have occurred in the lifetime of this statistic.
 float getRate()
          Return the rate of events per unit time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnlockedRateStatistic

public UnlockedRateStatistic(long averagePeriod,
                             TimeUnit unit)
Create an UnlockedRateStatistic instance with the given average period.

Parameters:
averagePeriod - average period
unit - period time unit
Method Detail

event

public void event()
Fired to record the occurrence of a monitored event.


getCount

public long getCount()
Returns the total number of events that have occurred in the lifetime of this statistic.

Returns:
total number of events

getRate

public float getRate()
Return the rate of events per unit time.

Returns:
event rate

ehcache

Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.