org.perf4j.helpers
Class StatsValueRetriever

java.lang.Object
  extended by org.perf4j.helpers.StatsValueRetriever

public abstract class StatsValueRetriever
extends java.lang.Object

The StatsValueRetriever is used to enable retrieval of any of the statistics on the TimingStatistics object by name. In addition, retrieval of a transactions per second statistic is supported.

Author:
Alex Devine

Field Summary
static StatsValueRetriever COUNT_VALUE_RETRIEVER
           
static java.util.Map<java.lang.String,StatsValueRetriever> DEFAULT_RETRIEVERS
          Default unmodifiable Map of statistic name to the corresponding StatsValueRetriever object that retrieves that statistic.
static StatsValueRetriever MAX_VALUE_RETRIEVER
           
static StatsValueRetriever MEAN_VALUE_RETRIEVER
           
static StatsValueRetriever MIN_VALUE_RETRIEVER
           
static StatsValueRetriever STD_DEV_VALUE_RETRIEVER
           
static StatsValueRetriever TPS_VALUE_RETRIEVER
           
 
Constructor Summary
StatsValueRetriever()
           
 
Method Summary
abstract  java.lang.Number getStatsValue(TimingStatistics timingStats, long windowLength)
          Retrieves a single statistic value from the specified TimingStatistics object.
abstract  java.lang.Class getValueClass()
          Gets the class of the object returned by getStatsValue(org.perf4j.TimingStatistics, long).
abstract  java.lang.String getValueName()
          Returns the name of the value, such as "Mean" or "Max".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEAN_VALUE_RETRIEVER

public static final StatsValueRetriever MEAN_VALUE_RETRIEVER

STD_DEV_VALUE_RETRIEVER

public static final StatsValueRetriever STD_DEV_VALUE_RETRIEVER

MIN_VALUE_RETRIEVER

public static final StatsValueRetriever MIN_VALUE_RETRIEVER

MAX_VALUE_RETRIEVER

public static final StatsValueRetriever MAX_VALUE_RETRIEVER

COUNT_VALUE_RETRIEVER

public static final StatsValueRetriever COUNT_VALUE_RETRIEVER

TPS_VALUE_RETRIEVER

public static final StatsValueRetriever TPS_VALUE_RETRIEVER

DEFAULT_RETRIEVERS

public static final java.util.Map<java.lang.String,StatsValueRetriever> DEFAULT_RETRIEVERS
Default unmodifiable Map of statistic name to the corresponding StatsValueRetriever object that retrieves that statistic. Statistic names are Mean, StdDev, Min, Max, Count and TPS.

Constructor Detail

StatsValueRetriever

public StatsValueRetriever()
Method Detail

getStatsValue

public abstract java.lang.Number getStatsValue(TimingStatistics timingStats,
                                               long windowLength)
Retrieves a single statistic value from the specified TimingStatistics object.

Parameters:
timingStats - The TimingStatistics object containing the data to be retrieved. May be null, if so 0 is returned.
windowLength - The length of time, in milliseconds, of the data window represented by the TimingStatistics.
Returns:
The value requested.

getValueClass

public abstract java.lang.Class getValueClass()
Gets the class of the object returned by getStatsValue(org.perf4j.TimingStatistics, long).

Returns:
The value class.

getValueName

public abstract java.lang.String getValueName()
Returns the name of the value, such as "Mean" or "Max".

Returns:
The name of the value retrieved.


Copyright © 2008 perf4j.org. All Rights Reserved.