public class MetricData
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AMETRIC_TAG |
static java.lang.String |
ANINTERVAL_TAG |
static java.lang.String |
INTERVAL_TYPE |
static java.lang.String |
INTERVALS_TAG |
static java.lang.String |
INTERVALSCOUNT_TAG |
static java.lang.String |
INTERVALSMETRICS_TAG |
static java.lang.String |
METRICS_TAG |
static java.lang.String |
separator |
Constructor and Description |
---|
MetricData() |
MetricData(org.w3c.dom.Element parentEl)
This will construct a MetricData from an XML document.
|
MetricData(MetricData md)
Clone this MetricData object
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
addMetric(java.lang.String uniqName)
This method is called to create a logical "column" if you will to store data
in via subsequent calls to setValue().
|
void |
addValue(java.lang.Object metric,
java.lang.Object value)
How you append your metric's data to the logical table.
|
void |
fillListWithValues(java.util.List list,
java.lang.Object metric,
int rows)
A convenience method for filling a List with the most recent 'rows' number
of values for the given metric.
|
void |
finishDataCollection() |
java.lang.Object |
getCurrentValue(java.lang.Object metric)
Gets the most recently added value for a given metric
|
com.itko.lisa.stats.Interval |
getInterval(java.lang.Object metric,
int row) |
int |
getIntervalCount() |
java.util.List |
getIntervalList()
Here's the list of lists of Interval objects.
|
java.util.List |
getIntervalNameList() |
int |
getIntervalSize() |
java.util.List |
getMetricHandleList()
If you get handed a MetricData object and have no idea what metrics are being
collected, you can call this method to get a list of the handles we are tracking.
|
java.util.List |
getReportMetricIntervals(java.lang.Object metricHandle) |
java.lang.Object |
getValueFromBottom(java.lang.Object metric,
int rowsBack)
Gets the value for the given metric a given number of
rows up from the bottom.
|
double[] |
getValueRangeCounter(java.lang.Object metric)
This method will scan all the intervals that have been created for the given metic
and return a array of the lowest and highest average values thus far
Metrics that are of the Counter variety will want this calc more than the
Guage type.
|
double[] |
getValueRangeCounterRecent(java.lang.Object metric)
This method will scan all the recentm metrics that have been created for the given metic
and return a array of the lowest and highest average values thus far
|
double[] |
getValueRangeGuage(java.lang.Object metric)
This method will scan all the intervals that have been created for the given metic
and return a array of the lowest and highest average values thus far
|
double[] |
getValueRangeGuageRecent(java.lang.Object metric)
This method will scan all the recent metrics that have been created for the given metic
and return a array of the lowest and highest average values thus far.
|
boolean |
isCollectionComplete() |
void |
saveIntervals(boolean asXML,
java.io.PrintWriter ps,
java.util.List msiList,
java.lang.String runName)
Writes the interval data collection we have caclulated thus far (or all of them if
we are done with the test.)
|
void |
saveMetrics(boolean asXML,
java.io.PrintWriter ps,
java.util.List msiList,
java.lang.String runName)
Writes the current set of metrics (this is everything we have collected since the last
interval was reached).
|
void |
setIntervalSize(int intervalSize) |
int |
size()
This is the size of the logical table.
|
void |
writeIntervalsAsCSV(java.io.PrintWriter ps,
java.util.List msiList,
java.lang.String runName) |
void |
writeIntervalsAsXML(java.io.PrintWriter ps,
boolean writeHeader,
java.util.List msiList,
java.lang.String runName)
Writes all the interval data to an XML doc.
|
void |
writeXML(java.io.PrintWriter ps,
java.util.List msiList,
java.lang.String runName) |
public static final java.lang.String separator
public static final java.lang.String INTERVALS_TAG
public static final java.lang.String ANINTERVAL_TAG
public static final java.lang.String INTERVALSCOUNT_TAG
public static final java.lang.String INTERVALSMETRICS_TAG
public static final java.lang.String AMETRIC_TAG
public static final java.lang.String INTERVAL_TYPE
public static final java.lang.String METRICS_TAG
public MetricData(org.w3c.dom.Element parentEl)
parentEl
- the parent XML element, like the docElement in most cases.public MetricData()
public MetricData(MetricData md)
md
- public void finishDataCollection()
public boolean isCollectionComplete()
public void setIntervalSize(int intervalSize)
public int getIntervalSize()
public java.util.List getIntervalList()
public java.util.List getIntervalNameList()
public int getIntervalCount()
public com.itko.lisa.stats.Interval getInterval(java.lang.Object metric, int row)
public double[] getValueRangeGuage(java.lang.Object metric)
metric
- public double[] getValueRangeGuageRecent(java.lang.Object metric)
metric
- public double[] getValueRangeCounter(java.lang.Object metric)
metric
- public double[] getValueRangeCounterRecent(java.lang.Object metric)
metric
- public java.util.List getMetricHandleList()
public java.lang.Object addMetric(java.lang.String uniqName)
public void addValue(java.lang.Object metric, java.lang.Object value)
metric
- handle of the metric to add the value forvalue
- the value to storepublic java.lang.Object getCurrentValue(java.lang.Object metric)
metric
- what metric you want the value forpublic java.lang.Object getValueFromBottom(java.lang.Object metric, int rowsBack)
metric
- what metric you want the value forrowsBack
- how far back you want to go for the valuepublic int size()
public void fillListWithValues(java.util.List list, java.lang.Object metric, int rows)
list
- - the List you want filled, I will CLEAR its contents and replace
it with 'rows' number of elementsmetric
- - the metric whose values you wantrows
- - how many values you wantpublic void saveMetrics(boolean asXML, java.io.PrintWriter ps, java.util.List msiList, java.lang.String runName)
asXML
- write as XML or CSV?ps
- stream to persist intomsiList
- list of Metric objects to saverunName
- the run name for this (some methods have a place to save this)public void saveIntervals(boolean asXML, java.io.PrintWriter ps, java.util.List msiList, java.lang.String runName)
asXML
- write as XML or CSV?ps
- stream to persist intomsiList
- list of Metric objects to saverunName
- the run name for this (some methods have a place to save this)public void writeXML(java.io.PrintWriter ps, java.util.List msiList, java.lang.String runName)
public void writeIntervalsAsXML(java.io.PrintWriter ps, boolean writeHeader, java.util.List msiList, java.lang.String runName)
public java.util.List getReportMetricIntervals(java.lang.Object metricHandle)
public void writeIntervalsAsCSV(java.io.PrintWriter ps, java.util.List msiList, java.lang.String runName)
Copyright © 1998-2014 CA, Inc. All Rights Reserved.