|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gridlab.gat.monitoring.MetricDefinition
public class MetricDefinition
An instance of this class is a decription of a measurable quantity within a monitoring system. The GAT user can use this class to create metrics by supplying parameters. For continuous metrics, a frequency can also be provided. For instance, a MetricDefinition could describe a diskFree metric. By supplying the deviceName ("/dev/hda1") as a parameter to the createMetric method and "every 5 minutes" as the frequency, the user can create a metric. This metric is then used to interact with the monitoring system. There are two classes of Metrics a monitoring system must deal with:
A MetricDefinition definition contains the following information:
name The MetricDefinition name is used to identify the Metric definition (e.g. CPU usage). It consists of dot separated words, e.g. host.cpu.user. The last component of a MetricDefinition name is the actual name of the MetricDefinition, the preceding components are called scope. The scope can be used to group MetricDefinitions as well as to differentiate between similar MetricDefinitions defined at different levels (for example, CPU utilisation can be measured on a per-job or per-host level).
measurement type The MetricDefinition Measurement type can be
data type The MetricDefinition data type contains the definition of the storage used for representing measurement data.
unit The MetricDefinition unit specifies the physical unit in which the MetricDefinition is measured as a java.lang.String. It is only valid for simple numeric types and java.util.List's of these types. In the latter case it means the unit of all elements of the java.util.List.
Field Summary | |
---|---|
static int |
CONTINUOUS
|
static int |
DISCRETE
|
Constructor Summary | |
---|---|
MetricDefinition(String metricName,
int measurementType,
String dataType,
String unit,
Map<String,Object> parameterDefinitions,
Map<String,Object> returnDefinition)
|
Method Summary | |
---|---|
Metric |
createMetric()
Create a metric according to this definition. |
Metric |
createMetric(Map<String,Object> parameters)
Create a metric according to this definition. |
Metric |
createMetric(Map<String,Object> parameters,
long frequency)
Create a metric according to this definition. |
boolean |
equals(Object o)
|
String |
getDataType()
|
int |
getMeasurementType()
|
String |
getMetricName()
|
Map<String,Object> |
getParameterDefinitions()
returns a map of parameter names and types that are needed to retrieve this metric. |
Map<String,Object> |
getReturnDefinition()
returns a map of return value names and types that are generated by this metric. |
String |
getUnit()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CONTINUOUS
public static final int DISCRETE
Constructor Detail |
---|
public MetricDefinition(String metricName, int measurementType, String dataType, String unit, Map<String,Object> parameterDefinitions, Map<String,Object> returnDefinition)
metricName
- measurementType
- dataType
- unit
- Method Detail |
---|
public Metric createMetric() throws GATInvocationException
GATInvocationException
public Metric createMetric(Map<String,Object> parameters)
parameters
- the parameters to this metricDefinition. For instance,
when creating a diskFree metric, a parameter could be the
physical device name. If no special parameters are needed,
it is OK to pass null
public Metric createMetric(Map<String,Object> parameters, long frequency)
parameters
- the parameters to this metricDefinition. For instance,
when creating a diskFree metric, a parameter could be the
physical device name. If no special parameters are needed,
it is OK to pass null
public boolean equals(Object o)
equals
in class Object
public String getDataType()
public int getMeasurementType()
public String getMetricName()
public String getUnit()
public Map<String,Object> getParameterDefinitions()
public String toString()
toString
in class Object
public Map<String,Object> getReturnDefinition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |