org.glassfish.external.statistics.impl
Class StatisticImpl

java.lang.Object
  extended by org.glassfish.external.statistics.impl.StatisticImpl
All Implemented Interfaces:
Statistic
Direct Known Subclasses:
AverageRangeStatisticImpl, BoundaryStatisticImpl, BoundedRangeStatisticImpl, CountStatisticImpl, RangeStatisticImpl, StringStatisticImpl, TimeStatisticImpl

public abstract class StatisticImpl
extends Object
implements Statistic

Author:
Sreenivas Munnangi

Field Summary
static String LAST_SAMPLE_TIME
           
protected static String NEWLINE
           
protected  long sampleTime
           
static String START_TIME
           
protected  Map<String,Object> statMap
           
static String UNIT_COUNT
           
static String UNIT_MICROSECOND
           
static String UNIT_MILLISECOND
           
static String UNIT_NANOSECOND
           
static String UNIT_SECOND
           
 
Constructor Summary
protected StatisticImpl(String name, String unit, String desc)
           
protected StatisticImpl(String name, String unit, String desc, long start_time, long sample_time)
           
 
Method Summary
protected  void checkMethod(Method method)
           
 String getDescription()
          A human-readable description of the Statistic.
 long getLastSampleTime()
          The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
 String getName()
          The name of this Statistic.
 long getStartTime()
          The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
 Map getStaticAsMap()
           
 String getUnit()
          The unit of measurement for this Statistic.
protected static boolean isValidString(String str)
           
 void reset()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sampleTime

protected long sampleTime

UNIT_COUNT

public static final String UNIT_COUNT
See Also:
Constant Field Values

UNIT_SECOND

public static final String UNIT_SECOND
See Also:
Constant Field Values

UNIT_MILLISECOND

public static final String UNIT_MILLISECOND
See Also:
Constant Field Values

UNIT_MICROSECOND

public static final String UNIT_MICROSECOND
See Also:
Constant Field Values

UNIT_NANOSECOND

public static final String UNIT_NANOSECOND
See Also:
Constant Field Values

START_TIME

public static final String START_TIME
See Also:
Constant Field Values

LAST_SAMPLE_TIME

public static final String LAST_SAMPLE_TIME
See Also:
Constant Field Values

statMap

protected final Map<String,Object> statMap

NEWLINE

protected static final String NEWLINE
Constructor Detail

StatisticImpl

protected StatisticImpl(String name,
                        String unit,
                        String desc,
                        long start_time,
                        long sample_time)

StatisticImpl

protected StatisticImpl(String name,
                        String unit,
                        String desc)
Method Detail

getStaticAsMap

public Map getStaticAsMap()

getName

public String getName()
Description copied from interface: Statistic
The name of this Statistic.

Specified by:
getName in interface Statistic

getDescription

public String getDescription()
Description copied from interface: Statistic
A human-readable description of the Statistic.

Specified by:
getDescription in interface Statistic

getUnit

public String getUnit()
Description copied from interface: Statistic
The unit of measurement for this Statistic. Valid values for TimeStatistic measurements are "HOUR", "MINUTE", "SECOND", "MILLISECOND", "MICROSECOND" and "NANOSECOND".

Specified by:
getUnit in interface Statistic

getLastSampleTime

public long getLastSampleTime()
Description copied from interface: Statistic
The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.

Specified by:
getLastSampleTime in interface Statistic

getStartTime

public long getStartTime()
Description copied from interface: Statistic
The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.

Specified by:
getStartTime in interface Statistic

reset

public void reset()

toString

public String toString()
Overrides:
toString in class Object

isValidString

protected static boolean isValidString(String str)

checkMethod

protected void checkMethod(Method method)


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.