Class StatisticImpl
- java.lang.Object
-
- 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 java.lang.Object implements Statistic
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLAST_SAMPLE_TIMEprotected static java.lang.StringNEWLINEprotected longsampleTimestatic java.lang.StringSTART_TIMEprivate longstartTimeprivate java.lang.StringstatisticDescprivate java.lang.StringstatisticNameprivate java.lang.StringstatisticUnitprotected java.util.Map<java.lang.String,java.lang.Object>statMapstatic java.lang.StringUNIT_COUNTstatic java.lang.StringUNIT_MICROSECONDstatic java.lang.StringUNIT_MILLISECONDstatic java.lang.StringUNIT_NANOSECONDstatic java.lang.StringUNIT_SECOND
-
Constructor Summary
Constructors Modifier Constructor Description protectedStatisticImpl(java.lang.String name, java.lang.String unit, java.lang.String desc)protectedStatisticImpl(java.lang.String name, java.lang.String unit, java.lang.String desc, long start_time, long sample_time)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckMethod(java.lang.reflect.Method method)java.lang.StringgetDescription()A human-readable description of the Statistic.longgetLastSampleTime()The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.java.lang.StringgetName()The name of this Statistic.longgetStartTime()The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.java.util.MapgetStaticAsMap()java.lang.StringgetUnit()The unit of measurement for this Statistic.protected static booleanisValidString(java.lang.String str)voidreset()java.lang.StringtoString()
-
-
-
Field Detail
-
statisticName
private final java.lang.String statisticName
-
statisticUnit
private final java.lang.String statisticUnit
-
statisticDesc
private final java.lang.String statisticDesc
-
sampleTime
protected long sampleTime
-
startTime
private long startTime
-
UNIT_COUNT
public static final java.lang.String UNIT_COUNT
- See Also:
- Constant Field Values
-
UNIT_SECOND
public static final java.lang.String UNIT_SECOND
- See Also:
- Constant Field Values
-
UNIT_MILLISECOND
public static final java.lang.String UNIT_MILLISECOND
- See Also:
- Constant Field Values
-
UNIT_MICROSECOND
public static final java.lang.String UNIT_MICROSECOND
- See Also:
- Constant Field Values
-
UNIT_NANOSECOND
public static final java.lang.String UNIT_NANOSECOND
- See Also:
- Constant Field Values
-
START_TIME
public static final java.lang.String START_TIME
- See Also:
- Constant Field Values
-
LAST_SAMPLE_TIME
public static final java.lang.String LAST_SAMPLE_TIME
- See Also:
- Constant Field Values
-
statMap
protected final java.util.Map<java.lang.String,java.lang.Object> statMap
-
NEWLINE
protected static final java.lang.String NEWLINE
-
-
Method Detail
-
getStaticAsMap
public java.util.Map getStaticAsMap()
-
getName
public java.lang.String getName()
Description copied from interface:StatisticThe name of this Statistic.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:StatisticA human-readable description of the Statistic.- Specified by:
getDescriptionin interfaceStatistic
-
getUnit
public java.lang.String getUnit()
Description copied from interface:StatisticThe unit of measurement for this Statistic. Valid values for TimeStatistic measurements are "HOUR", "MINUTE", "SECOND", "MILLISECOND", "MICROSECOND" and "NANOSECOND".
-
getLastSampleTime
public long getLastSampleTime()
Description copied from interface:StatisticThe 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:
getLastSampleTimein interfaceStatistic
-
getStartTime
public long getStartTime()
Description copied from interface:StatisticThe 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:
getStartTimein interfaceStatistic
-
reset
public void reset()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isValidString
protected static boolean isValidString(java.lang.String str)
-
checkMethod
protected void checkMethod(java.lang.reflect.Method method)
-
-