|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.grandcentral.appstats.impl.StatImpl | +--com.grandcentral.appstats.impl.SynchronizedStatImpl
Synchronized Stat implementation
Copyright: Copyright (c) 2002
Company: Grand Central Communications
Fields inherited from class com.grandcentral.appstats.impl.StatImpl |
m_aDouble, m_aggr, m_aLong, m_name, m_obj, m_type |
Fields inherited from interface com.grandcentral.appstats.Stat |
AGGREGATE_AVG, AGGREGATE_EXPAVG, AGGREGATE_MAX, AGGREGATE_MIN, AGGREGATE_REPLACE, AGGREGATE_SUM, DELIM_STATNAME, DELIM_STATPREFIX, DELIM_TASKPARENT, DONT_AGGREGATE, TYPE_DOUBLE, TYPE_HEIRARCH, TYPE_HIDDEN, TYPE_LONG, TYPE_OBJECT, TYPE_UNDEFINED |
Constructor Summary | |
SynchronizedStatImpl()
|
Method Summary | |
void |
addType(int type)
add a type to this stat |
java.lang.Object |
clone()
|
boolean |
containsType(int type)
returns true if this Stat is configured with param type |
void |
fromStringAbbr(java.lang.String s)
parses what it can from abbreviated form. |
int |
getAggregationMethod()
Returns the aggregation method for this stat. |
double |
getDouble()
|
java.lang.String |
getFullName()
A Stat's full name is composed of two distinct parts: a task hierarchy and a statName. |
long |
getLong()
|
java.lang.Object |
getObject()
|
java.lang.String |
getStatName()
A statName can be further broken down into a prefix and a suffix, as: |
java.lang.String |
getStatPrefix()
|
java.lang.String |
getStatSuffix()
|
java.lang.String |
getTaskHierarchy()
returns the task hierarchy from the full name of this stat |
int |
getType()
Returns the type for this stat. |
void |
prependTaskName(java.lang.String taskname)
prepends taskname + StatSource.DELIM_PARENT to the fullname of this stat |
void |
removeType(int type)
remove a type from this stat. |
void |
setAggregationMethod(int am)
sets the aggregationMethod for this Stat. |
void |
setDouble(double num)
|
void |
setFullName(java.lang.String name)
sets the full name of this Stat. |
void |
setLong(long num)
|
void |
setObject(java.lang.Object o)
|
void |
setStatName(java.lang.String name)
sets the stat name. |
void |
setStatPrefix(java.lang.String name)
set the statName's prefix. |
void |
setStatSuffix(java.lang.String suffix)
|
void |
setTaskHierarchy(java.lang.String taskHierarchy)
sets the task hierarchy from the full name of this stat |
void |
setType(int type)
sets the type for this stat. |
java.lang.String |
toStringAbbr()
returns statName and values in String representation. |
Methods inherited from class com.grandcentral.appstats.impl.StatImpl |
addAggregationMethod, containsAggregationMethod, createFullName, createFullName, createStatName, getStatName, getStatPrefix, getStatSuffix, getTaskHierarchy, isValidPrefix, isValidStatName, isValidSuffix, isValidTaskName, prependTaskName, removeAggregationMethod, toString, toStringAbbr |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SynchronizedStatImpl()
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class StatImpl
public java.lang.String getFullName()
Stat
+ Stat.DELIM_STATNAME +
statNameStat.DELIM_STATNAME +
statNamegetFullName
in class StatImpl
com.grandcentral.appstats.Stat
Stat.getStatName()
,
Task.getName()
public void setFullName(java.lang.String name)
Stat
setFullName
in class StatImpl
com.grandcentral.appstats.impl.StatImpl
NullPointerException
- if name is nullpublic java.lang.String getStatName()
Stat
Stat.DELIM_STATPREFIX
+ suffixExamples:
httpTransactionLatency.min
httpTransactionLatency.max
httpTransactionLatency.avg
getStatName
in class StatImpl
com.grandcentral.appstats.Stat
DELIM_STATPREFIX
character)Stat.getFullName()
public void setStatName(java.lang.String name)
Stat
setStatName
in class StatImpl
com.grandcentral.appstats.impl.StatImpl
java.lang.IllegalArgumentException
- if name is not validNullPointerException
- if name is nullpublic java.lang.String getTaskHierarchy()
Stat
getTaskHierarchy
in class StatImpl
com.grandcentral.appstats.Stat
Stat.getFullName()
public void setTaskHierarchy(java.lang.String taskHierarchy)
Stat
setTaskHierarchy
in class StatImpl
com.grandcentral.appstats.Stat
name
- contains the task hierarchy, or can be null to clear this
Stat's taskHierarchyStat.getFullName()
public void prependTaskName(java.lang.String taskname)
Stat
prependTaskName
in class StatImpl
com.grandcentral.appstats.Stat
java.lang.IllegalArgumentException
- if taskname contains StatSource.DELIM_PARENT characterNullPointerException
- if taskname is nullpublic java.lang.String getStatPrefix()
getStatPrefix
in class StatImpl
com.grandcentral.appstats.Stat
Stat.getStatName()
public void setStatPrefix(java.lang.String name)
Stat
DELIM_STATPREFIX
character, nor the DELIM_STATNAME
character.setStatPrefix
in class StatImpl
com.grandcentral.appstats.Stat
NullPointerException
- if you try to set the name to a null valuejava.lang.IllegalArgumentException
- if the name is invalidStat.getStatName()
public java.lang.String getStatSuffix()
getStatSuffix
in class StatImpl
com.grandcentral.appstats.Stat
DELIM_STATPREFIX
character)Stat.getStatName()
,
Stat.getStatPrefix()
public void setStatSuffix(java.lang.String suffix)
setStatSuffix
in class StatImpl
public void setType(int type)
Stat
setType
in class StatImpl
public int getType()
Stat
Using multiple types in a stat allows for numerical comparison of string values, for instance, consider the case of a status Stat where you want the highest priority status of any task to filter down to the root task. You can set a numerical value along with a status String in each status Stat where numerically greater values correspond to more critical statae. Then call Stat.setAggregationMethod(AGGREGATE_MAX) and the status' stat will get filtered down in a task hierarchy so that if any child task has a high priority status the whole application will have that high priority status.
getType
in class StatImpl
com.grandcentral.appstats.Stat
see also the TYPE_{type} constants
public void addType(int type)
Stat
addType
in class StatImpl
public void removeType(int type)
Stat
removeType
in class StatImpl
public boolean containsType(int type)
Stat
containsType
in class StatImpl
com.grandcentral.appstats.Stat
public void setAggregationMethod(int am)
Stat
setAggregationMethod
in class StatImpl
public int getAggregationMethod()
Stat
AggregationMethods are used by StatAggregators when a Task aggregates Stats from another Task. Using a bitfield allows for multiple calculations to occur when a Stat is aggregated. For instance, when a timer statistic is aggregated, the aggregator will calculate minimum, maximum, and an exponential average value and place it into the destination task, because all Timers by default have aggregation methods of (AGGREGATE_MIN|AGGREGATE_MAX|AGGREGATE_EXPAVG)
AppStat's standard aggregation methods are stored in this class as AGGREGATE_* public static final ints. These values map to logic inside of the StatAggregatorImpl class. If a user wants to implement their own custom aggregation methods, they may use their own values and their own StatAggregator implementation. The standard aggregation methods are meant to cover 80-90% of the use cases, and that's why they are hardcoded into this class.
Alternatively, a user may also provide a StatCalculator to calculate further statistics on aggregation. (@see Task#registerStatCalculator)
getAggregationMethod
in class StatImpl
com.grandcentral.appstats.Stat
see also the AGGREGATE_{method} constants
public void setLong(long num)
setLong
in class StatImpl
public long getLong()
getLong
in class StatImpl
public void setDouble(double num)
setDouble
in class StatImpl
public double getDouble()
getDouble
in class StatImpl
public void setObject(java.lang.Object o)
setObject
in class StatImpl
public java.lang.Object getObject()
getObject
in class StatImpl
public java.lang.String toStringAbbr()
StatImpl
toStringAbbr
in class StatImpl
public void fromStringAbbr(java.lang.String s)
StatImpl
fromStringAbbr
in class StatImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |