org.glassfish.external.statistics.impl
Class AverageRangeStatisticImpl

java.lang.Object
  extended by org.glassfish.external.statistics.impl.StatisticImpl
      extended by org.glassfish.external.statistics.impl.AverageRangeStatisticImpl
All Implemented Interfaces:
java.lang.reflect.InvocationHandler, AverageRangeStatistic, RangeStatistic, Statistic

public final class AverageRangeStatisticImpl
extends StatisticImpl
implements AverageRangeStatistic, java.lang.reflect.InvocationHandler

An implementation of AverageRangeStatistic that provides ways to change the state externally through mutators. Convenience class that is useful for components that gather the statistical data. By merely changing the count (which is a mandatory measurement), rest of the statistical information could be deduced.


Field Summary
 
Fields inherited from class org.glassfish.external.statistics.impl.StatisticImpl
LAST_SAMPLE_TIME, NEWLINE, sampleTime, START_TIME, statMap, UNIT_COUNT, UNIT_MICROSECOND, UNIT_MILLISECOND, UNIT_NANOSECOND, UNIT_SECOND
 
Constructor Summary
AverageRangeStatisticImpl(long curVal, long highMark, long lowMark, java.lang.String name, java.lang.String unit, java.lang.String desc, long startTime, long sampleTime)
           
 
Method Summary
 long getAverage()
           
 long getCurrent()
          The current value of this attribute.
 long getHighWaterMark()
          The highest value this attribute has held since the beginninYg of the measurement.
 long getLowWaterMark()
          The lowest value this attribute has held since the beginning of the measurement.
 java.util.Map getStaticAsMap()
           
 AverageRangeStatistic getStatistic()
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 void reset()
           
 void setCurrent(long curVal)
           
 java.lang.String toString()
           
 
Methods inherited from class org.glassfish.external.statistics.impl.StatisticImpl
getDescription, getLastSampleTime, getName, getStartTime, getUnit, isValidString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.glassfish.external.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit
 

Constructor Detail

AverageRangeStatisticImpl

public AverageRangeStatisticImpl(long curVal,
                                 long highMark,
                                 long lowMark,
                                 java.lang.String name,
                                 java.lang.String unit,
                                 java.lang.String desc,
                                 long startTime,
                                 long sampleTime)
Method Detail

getStatistic

public AverageRangeStatistic getStatistic()

toString

public java.lang.String toString()
Overrides:
toString in class StatisticImpl

getStaticAsMap

public java.util.Map getStaticAsMap()
Overrides:
getStaticAsMap in class StatisticImpl

reset

public void reset()
Overrides:
reset in class StatisticImpl

getAverage

public long getAverage()
Specified by:
getAverage in interface AverageRangeStatistic

getCurrent

public long getCurrent()
Description copied from interface: RangeStatistic
The current value of this attribute.

Specified by:
getCurrent in interface RangeStatistic

setCurrent

public void setCurrent(long curVal)

getHighWaterMark

public long getHighWaterMark()
Description copied from interface: RangeStatistic
The highest value this attribute has held since the beginninYg of the measurement.

Specified by:
getHighWaterMark in interface RangeStatistic

getLowWaterMark

public long getLowWaterMark()
Description copied from interface: RangeStatistic
The lowest value this attribute has held since the beginning of the measurement.

Specified by:
getLowWaterMark in interface RangeStatistic

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable