|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridlab.gat.monitoring.Metric
public class Metric
An instance of this class represents a measurable quantity within a monitoring system. There are two classes of metrics a monitoring system must deal with:
A metric definition contains the following information:
Metric parameters The Metric parameters field in the metric definition contains the formal definition of the metric parameters. Many metrics can be measured at different places simultaneously. For example, CPU utilisation can be measured on several hosts or grid resources. The metric parameters can be used to distinguish between these different metric instances.
| Constructor Summary | |
|---|---|
Metric(MetricDefinition definition,
Map<String,Object> metricParameters)
Constructs a Metric instance from the passed Metric name and
concrete values for the Metric parameters. |
|
Metric(MetricDefinition definition,
Map<String,Object> metricParameters,
long frequency)
Constructs a Metric instance from the passed Metric name
and concrete values for the Metric parameters. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object object)
Tests this Metric for equality with the passed Object. |
MetricDefinition |
getDefinition()
Gets the MetricDefinition. |
long |
getFrequency()
Gets the measurement frequency in milliseconds. |
Object |
getMetricParameterByName(String name)
Gets the Metric parameter value associated with the passed
Metric parameter name. |
Map<String,Object> |
getMetricParameters()
Gets the Metric parameters associated with this Metric. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Metric(MetricDefinition definition,
Map<String,Object> metricParameters)
Metric instance from the passed Metric name and
concrete values for the Metric parameters. This constructor is used for
DISCRETE metrics. Hence, there is no frequency specified.
The passed Metric name must be equal, as determined by
String.equals(Object), to the Metric name in the desired
target MetricDefinition. In addition, the passed concrete values
for the Metric parameters must be of the same name and type as
the Metric parameters in the desired target
MetricDefinition. Also, all the required Metric
parameters as specified in the MetricDefinition must be present.
definition - The MetricDefinition to create an instance ofmetricParameters - The Metric parameters, a Map,
for the desired MetricDefinition.
public Metric(MetricDefinition definition,
Map<String,Object> metricParameters,
long frequency)
Metric instance from the passed Metric name
and concrete values for the Metric parameters. This constructor
is used for CONTINUOUS metrics. Hence, the frequency must be specified.
The passed Metric name must be equal, as determined by
String.equals(Object), to the Metric name in the desired
target MetricDefinition. In addition, the passed concrete values
for the Metric parameters must be of the same name and type as
the Metric parameters in the desired target
MetricDefinition. Also, all the required Metric
parameters as specified in the MetricDefinition must be present.
definition - The MetricDefinition to create an instance ofmetricParameters - The Metric parameters, a Map,
for the desired MetricDefinitionfrequency - The measuring frequency.| Method Detail |
|---|
public boolean equals(Object object)
Metric for equality with the passed Object.
If the given object is not a Metric, then this method
immediately returns false.
For two Metric instances to be considered as equal they must have
equal descriptors, parameters and frequency.
equals in class Objectobject - The Object to test for equality
public Map<String,Object> getMetricParameters()
Metric parameters associated with this Metric.
Metric parameters, a Mappublic long getFrequency()
public Object getMetricParameterByName(String name)
Metric parameter value associated with the passed
Metric parameter name. The value null is returned
if there is no Metric parameter value with the passed name.
name - The Metric parameter name, a
String, for which to obtain the
associated Metric
Metric parameter value, an Object,
associated with the passed Metric parameter name.public MetricDefinition getDefinition()
MetricDefinition.
MetricDefinitionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||