com.sun.enterprise.admin.monitor.stats
Class TimeStatisticImpl

java.lang.Object
  extended by com.sun.enterprise.admin.monitor.stats.StatisticImpl
      extended by com.sun.enterprise.admin.monitor.stats.TimeStatisticImpl
All Implemented Interfaces:
Serializable, Statistic, TimeStatistic

public class TimeStatisticImpl
extends StatisticImpl
implements TimeStatistic

An implementation of a TimeStatistic. All instances of this class are immutable. Provides all the necessary accessors for properties.

Since:
S1AS8.0
Author:
Muralidhar Vempaty, Kedar Mhaswade
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sun.enterprise.admin.monitor.stats.StatisticImpl
DEFAULT_UNIT, DEFAULT_VALUE, NEWLINE
 
Constructor Summary
TimeStatisticImpl(long counter, long maximumTime, long minimumTime, long totalTime, String name, String unit, String desc, long startTime, long sampleTime)
          Deprecated. use the other TimeStatisticImpl constructors. Counter, maxtime, mintime, totaltime, starttime last sampletime are automatically calculated at the first measurement.
TimeStatisticImpl(String name)
           
TimeStatisticImpl(String name, String unit)
           
TimeStatisticImpl(String name, String unit, String desc)
          Constructs an immutable instance of TimeStatistic.
 
Method Summary
 long getCount()
          Returns the number of times an operation was invoked
 long getMaxTime()
          Returns the maximum amount of time that it took for one invocation of an operation, since measurement started.
 long getMinTime()
          Returns the minimum amount of time that it took for one invocation of an operation, since measurement started.
 long getTotalTime()
          Returns the amount of time that it took for all invocations, since measurement started.
 String toString()
           
 
Methods inherited from class com.sun.enterprise.admin.monitor.stats.StatisticImpl
getDescription, getLastSampleTime, getName, getStartTime, getUnit, setDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.glassfish.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit
 

Constructor Detail

TimeStatisticImpl

public TimeStatisticImpl(String name)

TimeStatisticImpl

public TimeStatisticImpl(String name,
                         String unit)

TimeStatisticImpl

public TimeStatisticImpl(String name,
                         String unit,
                         String desc)
Constructs an immutable instance of TimeStatistic.

Parameters:
name - The name of the statistic
unit - The unit of measurement for this statistic
desc - A brief description of the statistic

TimeStatisticImpl

public TimeStatisticImpl(long counter,
                         long maximumTime,
                         long minimumTime,
                         long totalTime,
                         String name,
                         String unit,
                         String desc,
                         long startTime,
                         long sampleTime)
Deprecated. use the other TimeStatisticImpl constructors. Counter, maxtime, mintime, totaltime, starttime last sampletime are automatically calculated at the first measurement.

Constructs an immutable instance of TimeStatistic.

Parameters:
counter - The number of times an operation has been invoked since measurement started
maximumTime - The maximum time it took to complete one invocation of an operation, since the measurement started
minimumTime - The minimum time it took to complete one invocation of an opeation, since the measurement started
totalTime - The total amount of time spent in all invocations, over the duration of the measurement
name - The name of the statistic
unit - The unit of measurement for this statistic
desc - A brief description of the statistic
startTime - Time in milliseconds at which the measurement was started
sampleTime - Time at which the last measurement was done.
Method Detail

toString

public final String toString()
Overrides:
toString in class StatisticImpl

getCount

public long getCount()
Returns the number of times an operation was invoked

Specified by:
getCount in interface TimeStatistic
Returns:
long indicating the number of invocations

getMaxTime

public long getMaxTime()
Returns the maximum amount of time that it took for one invocation of an operation, since measurement started.

Specified by:
getMaxTime in interface TimeStatistic
Returns:
long indicating the maximum time for one invocation

getMinTime

public long getMinTime()
Returns the minimum amount of time that it took for one invocation of an operation, since measurement started.

Specified by:
getMinTime in interface TimeStatistic
Returns:
long indicating the minimum time for one invocation

getTotalTime

public long getTotalTime()
Returns the amount of time that it took for all invocations, since measurement started.

Specified by:
getTotalTime in interface TimeStatistic
Returns:
long indicating the total time for all invocation


Copyright © 2012. All Rights Reserved.