|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaos.metrics.Metric
public class Metric
From: http://techrepublic.com.com/html/tr/sidebars/1045673-3.html Represents an individual metric. Each metric stores a long value or date value (which is a long). The metrics are kept and managed by the Metric Manager.
MetricManager
Field Summary | |
---|---|
static int |
AVERAGE_METRIC
Identifies the generic Average metric. |
static int |
ELAPSED_TIME_METRIC
Identifies the generic Elapsed Time metric. |
static int |
INDICATOR_METRIC
Identifies the generic Indicator metric. |
static int |
STATIC_METRIC
Identifies the generic Static metric. |
static int |
TIME_STAMP_METRIC
Identifies the generic TimeStamp metric. |
Constructor Summary | |
---|---|
Metric()
Construct a default Metric object. |
|
Metric(int pMetricType,
java.lang.String pMetricId,
java.lang.String pMetricName,
boolean pCanReset,
java.lang.String pMetricDescription)
Construct a default Metric object using the specified values. |
Method Summary | |
---|---|
void |
add(java.util.Date pMetricValue)
Add method increases or sets a metrics value. |
void |
add(java.util.GregorianCalendar pMetricValue)
Add method increases or sets a metrics value. |
void |
add(int pMetricValue)
Add method increases or sets a metrics value. |
void |
add(long pMetricValue)
Add method increases or sets a metrics value. |
float |
getAverage()
Returns the metric's average value. |
boolean |
getCanReset()
|
long |
getDataPointCount()
Returns the metric's count of data points. |
java.lang.String |
getDescription()
|
java.lang.String |
getId()
|
java.lang.String |
getName()
|
java.util.GregorianCalendar |
getTimeStamp()
Returns the metric's TimeStamp value. |
int |
getType()
|
long |
getValue()
Returns the metric's value. |
void |
reset()
Resets all values to zero or null. |
java.lang.String |
toString()
The Metric value is returned as a string for logs or screen output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TIME_STAMP_METRIC
public static final int ELAPSED_TIME_METRIC
public static final int INDICATOR_METRIC
public static final int STATIC_METRIC
public static final int AVERAGE_METRIC
Constructor Detail |
---|
public Metric()
public Metric(int pMetricType, java.lang.String pMetricId, java.lang.String pMetricName, boolean pCanReset, java.lang.String pMetricDescription)
pMetricType
- Metric type number.pMetricId
- The metric id used to find this metric.pMetricName
- Descriptive name of metric.pCanReset
- True or False to control whether value can be reset.pMetricDescription
- Descriptive text in addition to the name.Method Detail |
---|
public java.lang.String getId()
public java.lang.String getName()
public java.lang.String getDescription()
public int getType()
public boolean getCanReset()
public void add(int pMetricValue)
pMetricValue
- value to be added to the current Metric.public void add(long pMetricValue)
pMetricValue
- value to be added to the current Metric.public void add(java.util.Date pMetricValue)
pMetricValue
- date value to be applied to the current Metric.public void add(java.util.GregorianCalendar pMetricValue)
pMetricValue
- calendar value to be applied to the current Metric.public long getValue()
public float getAverage()
public java.util.GregorianCalendar getTimeStamp()
public long getDataPointCount()
public java.lang.String toString()
toString
in class java.lang.Object
public void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |