public abstract class MetricCollector
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static double |
AUTO_SCALE |
static java.lang.String |
AUTO_SCALE_STRING |
static java.lang.String |
PREF_COLOR_TAG |
static java.lang.String |
SCALE_TAG |
static java.lang.String[] |
SCALES_STRINGS |
static int |
VALUE_COUNTER
Values coming from the collector in the getCurrentValue() method are of type Number
(which can be any of Integer, Float, Double, etc.), and they are constantly
increasing.
|
static int |
VALUE_GAUGE
Values coming from the collector are a GAUGE, meaning that they are a current
reading at a certain time.
|
static int |
VALUE_STRING
Values coming from the collector in the getCurrentValue() method are of type String
|
static java.lang.String[] |
VALUETYPE_STRINGS
Needed when we want to do something fun with the value type, like make a combo
|
static java.lang.String |
VALUETYPE_TAG |
Constructor and Description |
---|
MetricCollector() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static int |
convertValueType(java.lang.String valueType) |
abstract com.itko.lisa.report.model.Metric |
createReportMetric(int sampleRate,
int intervalSize) |
boolean |
defaultOnGraph()
Some callers to this class might want to know if we think this particular metric
should be showing by default
Subclasses should override this and return true if they think so
|
boolean |
defaultOnSummary()
Some callers to this class might want to know if we think this particular metric
should be showing in the summary by default
Subclasses should override this and return true if they think so
|
protected abstract java.lang.Object |
fetchMetricValue()
Called by the parent to fetch the current metric value
|
AlertEmail |
getAlertEmail()
Tells us if there's an alert attached to the Collector or null if there isn't one
|
Coordinator |
getCoordinator()
This method is of interest to subclasses that need to get a handle to the Coordinator
for this test
|
java.lang.Object |
getCurrentValue()
Called to ask this collector to do it's job -- go get the current value for the
metric we're tracking.
|
abstract java.lang.String |
getMetricHelpString()
Called when we want a human-readable "one-liner" about the value you are
tracking.
|
protected long |
getMetricInitializationTimeout() |
java.awt.Color |
getPreferredColor()
Metrics collectors can support a feature that gives them the chance to tell the rest of
the world what Color they would like to be rendered in.
|
java.text.NumberFormat |
getPreferredFormatter() |
double |
getScale()
This is the multiplier you should apply to the values that this collector provides to normalize the
values to between 0 and 100.
|
abstract java.lang.String |
getShortName()
Made this a stort-ish String that will fit in a table column, like: "LISA: Instances"
|
java.lang.String |
getTableVisibleScale() |
int |
getValueType()
Well we give you an Object, so what now?
|
void |
initialize() |
void |
initialize(org.w3c.dom.Element e)
Used by the factory that loads these guys from the
|
abstract void |
initializeCollector(org.w3c.dom.Element e)
Used by the factory that loads these guys from the
|
boolean |
isInitialized() |
boolean |
isValueNumber() |
boolean |
isValueString() |
void |
setAlertEmail(AlertEmail ae) |
void |
setCoordinator(Coordinator c)
This method is generally called by the TestManager when setting up metrics to be
used.
|
void |
setPreferredColor(java.awt.Color color) |
void |
setPreferredFormatter(java.text.NumberFormat preferredFormatter) |
void |
setScale(double scale) |
void |
setScale(java.lang.String scaleString) |
void |
setValueType(int valueType)
Subclasses know what type of value they are sending, so the subclass MUST
call this method as soon as possible to let the world know what it can do
with the results of a fetchMetricValue()
|
protected abstract void |
stopCollecting()
Called by the parent when we are done, release resources and etc.
|
protected boolean |
subInitializeCollector()
This method should be overridden in any metric Collector.
|
abstract void |
subWriteXML(java.io.PrintWriter ps)
This must be implemented to so we can save your parameters into an XML document
|
java.lang.String |
toString() |
void |
writeXML(java.io.PrintWriter ps)
This must be implemented to so we can save your parameters into an XML document
|
public static final java.lang.String SCALE_TAG
public static final java.lang.String VALUETYPE_TAG
public static final java.lang.String PREF_COLOR_TAG
public static final double AUTO_SCALE
public static final java.lang.String AUTO_SCALE_STRING
public static final java.lang.String[] SCALES_STRINGS
public static final int VALUE_STRING
public static final int VALUE_COUNTER
public static final int VALUE_GAUGE
public static final java.lang.String[] VALUETYPE_STRINGS
public boolean isInitialized()
public final void initialize()
protected long getMetricInitializationTimeout()
protected boolean subInitializeCollector()
public void setCoordinator(Coordinator c)
c
- the Coordinator of the test we are collecting forpublic Coordinator getCoordinator()
public AlertEmail getAlertEmail()
public void setAlertEmail(AlertEmail ae)
public double getScale()
public java.lang.String getTableVisibleScale()
public void setScale(java.lang.String scaleString)
public void setScale(double scale)
public java.lang.Object getCurrentValue()
public boolean isValueString()
public boolean isValueNumber()
public int getValueType()
public void close()
public boolean defaultOnGraph()
public boolean defaultOnSummary()
public java.awt.Color getPreferredColor()
public void setPreferredColor(java.awt.Color color)
public abstract java.lang.String getShortName()
public abstract java.lang.String getMetricHelpString()
protected abstract java.lang.Object fetchMetricValue()
public void setValueType(int valueType)
valueType
- public static int convertValueType(java.lang.String valueType)
protected abstract void stopCollecting()
public void initialize(org.w3c.dom.Element e) throws TestDefException
e
- TestDefException
public java.lang.String toString()
toString
in class java.lang.Object
public abstract void initializeCollector(org.w3c.dom.Element e) throws TestDefException
e
- TestDefException
public final void writeXML(java.io.PrintWriter ps)
ps
- public abstract void subWriteXML(java.io.PrintWriter ps)
ps
- public abstract com.itko.lisa.report.model.Metric createReportMetric(int sampleRate, int intervalSize)
public java.text.NumberFormat getPreferredFormatter()
public void setPreferredFormatter(java.text.NumberFormat preferredFormatter)
Copyright © 1998-2014 CA, Inc. All Rights Reserved.