com.ebay.carad.os.vitalsigns.dataretrievers
Class DifferenceQueryRateLogger

java.lang.Object
  extended by com.ebay.carad.os.vitalsigns.dataretrievers.QueryLogger
      extended by com.ebay.carad.os.vitalsigns.dataretrievers.DifferenceQueryLogger
          extended by com.ebay.carad.os.vitalsigns.dataretrievers.DifferenceQueryRateLogger
All Implemented Interfaces:
IDataRetriever, ITemplatizable, java.lang.Cloneable

public class DifferenceQueryRateLogger
extends DifferenceQueryLogger

Takes a difference query, and logs its value as a rate per time period. The time period is specified in minutes, via the constructor.

Data that is logged = CurrentCount / (System.currentTimeMillis() - lastTimeStamp) * millisPerInterval

Version:
$Id$
Author:
Jeremy Kraybill, Jeremy Thomerson

Field Summary
private  long lastTick
           
private static org.apache.log4j.Logger LOGGER
          Class logger.
private  long millisPer
           
 
Fields inherited from class com.ebay.carad.os.vitalsigns.dataretrievers.QueryLogger
ZERO
 
Fields inherited from interface com.ebay.carad.os.vitalsigns.IDataRetriever
NO_OP_DATA_RETRIEVER
 
Constructor Summary
DifferenceQueryRateLogger()
          Basic constructor.
 
Method Summary
 java.lang.Float getData()
           
 void setMinsPerTick(int minsPerTick)
          Sets the number of minutes to calculate rate against.
 
Methods inherited from class com.ebay.carad.os.vitalsigns.dataretrievers.DifferenceQueryLogger
getValue
 
Methods inherited from class com.ebay.carad.os.vitalsigns.dataretrievers.QueryLogger
clone, getData, getQuery, getSqlDAO, setQuery, setSqlDAO, templatize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final org.apache.log4j.Logger LOGGER
Class logger.


millisPer

private long millisPer

lastTick

private long lastTick
Constructor Detail

DifferenceQueryRateLogger

public DifferenceQueryRateLogger()
Basic constructor.

Method Detail

setMinsPerTick

public void setMinsPerTick(int minsPerTick)
Sets the number of minutes to calculate rate against. For instance, if you want to log this data as a rate per minute, minsPerTick should be 1; per hour, 60; etc.

Parameters:
minsPerTick - the number of minutes per interval

getData

public java.lang.Float getData()
Overrides:
getData in class DifferenceQueryLogger
See Also:
class comment for details, QueryLogger.getData()


Copyright © 2004-2009. All Rights Reserved.