|
|||||||||
| 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 StatImplpublic java.lang.String getFullName()
Stat + Stat.DELIM_STATNAME + statNameStat.DELIM_STATNAME + statNamegetFullName in class StatImplcom.grandcentral.appstats.StatStat.getStatName(),
Task.getName()public void setFullName(java.lang.String name)
StatsetFullName in class StatImplcom.grandcentral.appstats.impl.StatImplNullPointerException - if name is nullpublic java.lang.String getStatName()
Stat
Stat.DELIM_STATPREFIX + suffixExamples:
httpTransactionLatency.minhttpTransactionLatency.maxhttpTransactionLatency.avggetStatName in class StatImplcom.grandcentral.appstats.StatDELIM_STATPREFIX character)Stat.getFullName()public void setStatName(java.lang.String name)
StatsetStatName in class StatImplcom.grandcentral.appstats.impl.StatImpljava.lang.IllegalArgumentException - if name is not validNullPointerException - if name is nullpublic java.lang.String getTaskHierarchy()
StatgetTaskHierarchy in class StatImplcom.grandcentral.appstats.StatStat.getFullName()public void setTaskHierarchy(java.lang.String taskHierarchy)
StatsetTaskHierarchy in class StatImplcom.grandcentral.appstats.Statname - contains the task hierarchy, or can be null to clear this
Stat's taskHierarchyStat.getFullName()public void prependTaskName(java.lang.String taskname)
StatprependTaskName in class StatImplcom.grandcentral.appstats.Statjava.lang.IllegalArgumentException - if taskname contains StatSource.DELIM_PARENT characterNullPointerException - if taskname is nullpublic java.lang.String getStatPrefix()
getStatPrefix in class StatImplcom.grandcentral.appstats.StatStat.getStatName()public void setStatPrefix(java.lang.String name)
StatDELIM_STATPREFIX character, nor the DELIM_STATNAME
character.setStatPrefix in class StatImplcom.grandcentral.appstats.StatNullPointerException - 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 StatImplcom.grandcentral.appstats.StatDELIM_STATPREFIX character)Stat.getStatName(),
Stat.getStatPrefix()public void setStatSuffix(java.lang.String suffix)
setStatSuffix in class StatImplpublic void setType(int type)
StatsetType in class StatImplpublic int getType()
StatUsing 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 StatImplcom.grandcentral.appstats.Statsee also the TYPE_{type} constantspublic void addType(int type)
StataddType in class StatImplpublic void removeType(int type)
StatremoveType in class StatImplpublic boolean containsType(int type)
StatcontainsType in class StatImplcom.grandcentral.appstats.Statpublic void setAggregationMethod(int am)
StatsetAggregationMethod in class StatImplpublic int getAggregationMethod()
StatAggregationMethods 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 StatImplcom.grandcentral.appstats.Statsee also the AGGREGATE_{method} constantspublic void setLong(long num)
setLong in class StatImplpublic long getLong()
getLong in class StatImplpublic void setDouble(double num)
setDouble in class StatImplpublic double getDouble()
getDouble in class StatImplpublic void setObject(java.lang.Object o)
setObject in class StatImplpublic java.lang.Object getObject()
getObject in class StatImplpublic java.lang.String toStringAbbr()
StatImpltoStringAbbr in class StatImplpublic void fromStringAbbr(java.lang.String s)
StatImplfromStringAbbr in class StatImpl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||