|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright: Copyright (c) 2002
Company: Grand Central Communications
Field Summary | |
static int |
AGGREGATE_AVG
|
static int |
AGGREGATE_EXPAVG
|
static int |
AGGREGATE_MAX
|
static int |
AGGREGATE_MIN
|
static int |
AGGREGATE_REPLACE
|
static int |
AGGREGATE_SUM
|
static char |
DELIM_STATNAME
'^' == the delimiter to separate a stat name from the task hierarchy. |
static char |
DELIM_STATPREFIX
'.' == the delimiter to separate the StatSource name from the statSuffix. |
static char |
DELIM_TASKPARENT
'.' == the delimiter to separate parent and child tasknames -- tasknames must not contain this character |
static int |
DONT_AGGREGATE
|
static int |
TYPE_DOUBLE
indicates this Stat has a double value |
static int |
TYPE_HEIRARCH
Indicates that this stat is a hierarchical view of child task’s stats. |
static int |
TYPE_HIDDEN
a type to indicate that a Stat is hidden from view. |
static int |
TYPE_LONG
indicates this Stat has a long value |
static int |
TYPE_OBJECT
indicates this Stat has an Object value |
static int |
TYPE_UNDEFINED
a Stat with no value |
Method Summary | |
void |
addAggregationMethod(int agMethod)
add an aggregationMethod to this stat |
void |
addType(int type)
add a type to this stat |
java.lang.Object |
clone()
|
boolean |
containsAggregationMethod(int agMethod)
returns true if this Stat is configured with param agMethod |
boolean |
containsType(int type)
returns true if this Stat is configured with param type |
void |
fromStringAbbr(java.lang.String s)
Allows for lightweight/partial deserialization from a readable format |
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 |
removeAggregationMethod(int agMethod)
remove an aggregationMethod from this stat. |
void |
removeType(int type)
remove a type from this stat. |
void |
setAggregationMethod(int agMethod)
sets the aggregationMethod for this Stat. |
void |
setDouble(double aouble)
|
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 name)
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()
Allows for lightweight/partial serialization in a readable format |
void |
toStringAbbr(java.lang.StringBuffer s)
|
Field Detail |
public static final char DELIM_STATNAME
public static final char DELIM_STATPREFIX
getFullName()
,
getStatName()
,
getStatPrefix()
,
getStatSuffix()
public static final char DELIM_TASKPARENT
public static final int TYPE_UNDEFINED
public static final int TYPE_LONG
public static final int TYPE_DOUBLE
public static final int TYPE_OBJECT
public static final int TYPE_HIDDEN
public static final int TYPE_HEIRARCH
public static final int DONT_AGGREGATE
public static final int AGGREGATE_MIN
public static final int AGGREGATE_MAX
public static final int AGGREGATE_SUM
public static final int AGGREGATE_AVG
public static final int AGGREGATE_EXPAVG
public static final int AGGREGATE_REPLACE
Method Detail |
public java.lang.String getFullName()
+ Stat.DELIM_STATNAME +
statNameStat.DELIM_STATNAME +
statNamegetStatName()
,
Task.getName()
public void setFullName(java.lang.String name)
NullPointerException
- if you try to set the name to a null valuegetFullName()
public java.lang.String getStatName()
Stat.DELIM_STATPREFIX
+ suffixExamples:
httpTransactionLatency.min
httpTransactionLatency.max
httpTransactionLatency.avg
DELIM_STATPREFIX
character)getFullName()
public void setStatName(java.lang.String name)
NullPointerException
- if you try to set the name to a null valuejava.lang.IllegalArgumentException
- if the statName contains DELIM_STATNAME characterpublic java.lang.String getStatPrefix()
getStatName()
public void setStatPrefix(java.lang.String name)
DELIM_STATPREFIX
character, nor the DELIM_STATNAME
character.NullPointerException
- if you try to set the name to a null valuejava.lang.IllegalArgumentException
- if the name is invalidgetStatName()
public java.lang.String getStatSuffix()
DELIM_STATPREFIX
character)getStatName()
,
getStatPrefix()
public void setStatSuffix(java.lang.String suffix)
public java.lang.String getTaskHierarchy()
getFullName()
public void setTaskHierarchy(java.lang.String name)
name
- contains the task hierarchy, or can be null to clear this
Stat's taskHierarchygetFullName()
public void prependTaskName(java.lang.String taskname)
java.lang.IllegalArgumentException
- if taskname contains StatSource.DELIM_PARENT characterNullPointerException
- if taskname is nullpublic int getType()
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.
see also the TYPE_{type} constants
public void setType(int type)
public void addType(int type)
public void removeType(int type)
public boolean containsType(int type)
public int getAggregationMethod()
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)
see also the AGGREGATE_{method} constants
public void setAggregationMethod(int agMethod)
public void addAggregationMethod(int agMethod)
public void removeAggregationMethod(int agMethod)
public boolean containsAggregationMethod(int agMethod)
public void setLong(long num)
public long getLong()
public void setDouble(double aouble)
public double getDouble()
public void setObject(java.lang.Object o)
public java.lang.Object getObject()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
public java.lang.String toStringAbbr()
public void toStringAbbr(java.lang.StringBuffer s)
public void fromStringAbbr(java.lang.String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |