public class GangliaMetadataMessage extends AbstractGangliaMessage implements IGangliaMetadataMessage
This record must be sent if a service is reporting a metric for the first
time. In addition, ganglia resends the metadata records periodically by
tracking their age (but send_metadata_interval = 0 in the
default gmond.conf).
| Constructor and Description |
|---|
GangliaMetadataMessage(String hostName,
String metricName,
boolean spoof,
GangliaMessageTypeEnum metricType,
String metricName2,
String units,
GangliaSlopeEnum slope,
int tmax,
int dmax,
Map<String,String[]> extraValues) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getDescription()
Return the value of the well-known attribute
IGangliaAttributes.ATTR_DESC. |
int |
getDMax()
The maximum age in seconds before a metric will be deleted (aka Delete
Max).
|
Map<String,String[]> |
getExtraValues()
Zero or more additional name-value[] pairs serialized with this message.
|
String |
getFirstValue(String key)
Return the first value for the given key from the
IGangliaMetadataMessage.getExtraValues(). |
String[] |
getGroups()
Return the value of the well-known attribute
IGangliaAttributes.ATTR_TITLE. |
String |
getMetricName2()
The metric name (this is represented twice in the Ganglia 3.1 wire
format: once in the metric_id header and once in the metadata record;
both values SHOULD be the same).
|
GangliaMessageTypeEnum |
getMetricType()
The data type declaration for the metric.
|
GangliaSlopeEnum |
getSlope()
Hint for rrdtool visualization of metric values.
|
String |
getTitle()
Return the value of the well-known attribute
IGangliaAttributes.ATTR_TITLE. |
int |
getTMax()
The maximum advisory delay in seconds before a metric value would become
stale.
|
String |
getUnits()
The units in which the metric values are expressed.
|
int |
hashCode() |
boolean |
isChanged(Object oldValue,
Object newValue)
Return
true iff the newValue differs significantly from the
old value. |
boolean |
isMetricMetadata()
Return
true iff this message contains the metadata for a
metric (the metric declaration). |
boolean |
isMetricRequest()
Return
true iff this message is a request for a metric. |
boolean |
isMetricValue()
Return
true if this message represents a metric value. |
String |
toString() |
Object |
translateValue(Object value)
Return a value which may have been scaled and/or offset in order to align
the value with the metric declaration.
|
getHostName, getMetricName, getRecordType, isSpoofclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetHostName, getMetricName, getRecordType, isSpoofpublic GangliaMetadataMessage(String hostName, String metricName, boolean spoof, GangliaMessageTypeEnum metricType, String metricName2, String units, GangliaSlopeEnum slope, int tmax, int dmax, Map<String,String[]> extraValues)
public boolean isMetricValue()
IGangliaMessagetrue if this message represents a metric value.isMetricValue in interface IGangliaMessagepublic boolean isMetricRequest()
IGangliaMessagetrue iff this message is a request for a metric.isMetricRequest in interface IGangliaMessageGangliaMessageTypeEnum.REQUESTpublic boolean isMetricMetadata()
IGangliaMessagetrue iff this message contains the metadata for a
metric (the metric declaration).isMetricMetadata in interface IGangliaMessageGangliaMessageTypeEnum.METADATApublic GangliaMessageTypeEnum getMetricType()
IGangliaMetadataMessagegetMetricType in interface IGangliaMetadataMessagepublic String getMetricName2()
IGangliaMetadataMessagegetMetricName2 in interface IGangliaMetadataMessageIGangliaMessage.getMetricName()public String getUnits()
IGangliaMetadataMessagegetUnits in interface IGangliaMetadataMessagepublic GangliaSlopeEnum getSlope()
IGangliaMetadataMessagegetSlope in interface IGangliaMetadataMessagepublic int getTMax()
IGangliaMetadataMessagegetTMax in interface IGangliaMetadataMessagepublic int getDMax()
IGangliaMetadataMessagegetDMax in interface IGangliaMetadataMessagepublic Map<String,String[]> getExtraValues()
IGangliaMetadataMessagegetExtraValues in interface IGangliaMetadataMessagepublic String[] getGroups()
IGangliaMetadataMessageIGangliaAttributes.ATTR_TITLE.getGroups in interface IGangliaMetadataMessagenull.public String getTitle()
IGangliaMetadataMessageIGangliaAttributes.ATTR_TITLE.getTitle in interface IGangliaMetadataMessageIGangliaAttributes.ATTR_TITLE attribute if
present and otherwise null.public String getDescription()
IGangliaMetadataMessageIGangliaAttributes.ATTR_DESC.getDescription in interface IGangliaMetadataMessageIGangliaAttributes.ATTR_DESC attribute if
present and otherwise null.public String getFirstValue(String key)
IGangliaMetadataMessageIGangliaMetadataMessage.getExtraValues().getFirstValue in interface IGangliaMetadataMessagekey - The key.null if there are
no values for that key.public boolean equals(Object o)
equals in class AbstractGangliaMessagepublic int hashCode()
hashCode in class AbstractGangliaMessagepublic Object translateValue(Object value)
The default implementation is an identity transform. In order for this method to be applied the application MUST resolve metadata declarations received over the wire to local declarations in which this method has the desired behavior. This resolution step is necessary because the ganglia wire protocol is data-only and the translation steps can not be readily expressed as data (unless they are turned into a full formula evaluation model, adding substantial complexity to the ganglia integration). TODO We could also add a method which return true iff two values differ sufficient for an updated metric record to be sent out.
translateValue in interface IGangliaMetadataMessagevalue - The value.public boolean isChanged(Object oldValue, Object newValue)
true iff the newValue differs significantly from the
old value.
The default implementation returns true iff the two values
are not equals().
isChanged in interface IGangliaMetadataMessageoldValue - The old value and never null.newValue - The new value and never null.true iff there is a significant difference.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.