ehcache

net.sf.ehcache.util.ratestatistics
Class AtomicRateStatistic

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

public class AtomicRateStatistic
extends Object

A thread-safe rate statistic implementation.

Author:
Chris Dennis

Constructor Summary
AtomicRateStatistic(long averagePeriod, TimeUnit unit)
          Create an AtomicRateStatistic 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

AtomicRateStatistic

public AtomicRateStatistic(long averagePeriod,
                           TimeUnit unit)
Create an AtomicRateStatistic 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.