com.extrememessaging.ResponseMaster.monitor
Class RollingCount

java.lang.Object
  extended by com.extrememessaging.ResponseMaster.monitor.RollingCount
All Implemented Interfaces:
java.lang.Runnable

public class RollingCount
extends java.lang.Object
implements java.lang.Runnable

Class used in CStatisticalMonitorBase to keep track of the counts of various things over time.


Nested Class Summary
static interface RollingCount.IRollListener
           
static class RollingCount.PeriodEnum
          Used in call to GetValue to indicate whether the caller wants the current value, the last value, or the top value.
static class RollingCount.RollTypeEnum
          The type of rolling that occurred.
 
Constructor Summary
RollingCount()
           
 
Method Summary
 void AddRollListener(RollingCount.IRollListener listener)
           
 java.util.Calendar GetDate(RollingCount.RollTypeEnum rollType, RollingCount.PeriodEnum period)
          Returns the date of the data for the specified params, eg the top hour for RollTypeEnum.HOUR and PeridEnum.TOP
 long getLastHourValue()
          The number in the previous hour (eg 10-11 if it is 11:23)
 long getLastMinuteValue()
          The number in the previous minute (eg 11:22:00-11:22:59 if it is 11:23:12)
 long getThisHourValue()
          The number in this hour
 long getThisMinuteValue()
          The number in this minute
 long getTodayValue()
          The number in the currect day (eg 2005-10-02 00:00 to 2005-10-02 11:23 if it is 2005-10-02 11:23)
 java.util.Date getTopHour()
          The time for getTopHourValue
 long getTopHourValue()
          The number in the biggest hour
 java.util.Date getTopMinute()
          The time for getTopMinuteValue
 long getTopMinuteValue()
          The number in the biggest minute
 long getTotal()
          The total number with Initialize was called
 long GetValue(RollingCount.RollTypeEnum rollType, RollingCount.PeriodEnum period)
          Returns the value for the specified params, eg the top hour for RollTypeEnum.HOUR and PeridEnum.TOP
 long getYesterdayValue()
          The number in the previous day (eg 2005-10-01 00:00 to 2005-10-01 23:59 if it is 2005-10-02 11:23)
 void Increment()
           
 void Initialize()
           
 void RemoveRollListener(RollingCount.IRollListener listener)
           
 void run()
          Rolls all instances every second or so
static void Shutdown()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RollingCount

public RollingCount()
Method Detail

run

public void run()
Rolls all instances every second or so

Specified by:
run in interface java.lang.Runnable

Shutdown

public static void Shutdown()

Initialize

public void Initialize()

getTotal

public long getTotal()
The total number with Initialize was called


getTopMinuteValue

public long getTopMinuteValue()
The number in the biggest minute


getTopMinute

public java.util.Date getTopMinute()
The time for getTopMinuteValue


getTopHourValue

public long getTopHourValue()
The number in the biggest hour


getTopHour

public java.util.Date getTopHour()
The time for getTopHourValue


getThisHourValue

public long getThisHourValue()
The number in this hour


getThisMinuteValue

public long getThisMinuteValue()
The number in this minute


getLastHourValue

public long getLastHourValue()
The number in the previous hour (eg 10-11 if it is 11:23)


getLastMinuteValue

public long getLastMinuteValue()
The number in the previous minute (eg 11:22:00-11:22:59 if it is 11:23:12)


getYesterdayValue

public long getYesterdayValue()
The number in the previous day (eg 2005-10-01 00:00 to 2005-10-01 23:59 if it is 2005-10-02 11:23)


getTodayValue

public long getTodayValue()
The number in the currect day (eg 2005-10-02 00:00 to 2005-10-02 11:23 if it is 2005-10-02 11:23)


Increment

public void Increment()

AddRollListener

public void AddRollListener(RollingCount.IRollListener listener)

RemoveRollListener

public void RemoveRollListener(RollingCount.IRollListener listener)

GetValue

public long GetValue(RollingCount.RollTypeEnum rollType,
                     RollingCount.PeriodEnum period)
Returns the value for the specified params, eg the top hour for RollTypeEnum.HOUR and PeridEnum.TOP


GetDate

public java.util.Calendar GetDate(RollingCount.RollTypeEnum rollType,
                                  RollingCount.PeriodEnum period)
Returns the date of the data for the specified params, eg the top hour for RollTypeEnum.HOUR and PeridEnum.TOP