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, isSpoof
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getHostName, getMetricName, getRecordType, isSpoof
public 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()
IGangliaMessage
true
if this message represents a metric value.isMetricValue
in interface IGangliaMessage
public boolean isMetricRequest()
IGangliaMessage
true
iff this message is a request for a metric.isMetricRequest
in interface IGangliaMessage
GangliaMessageTypeEnum.REQUEST
public boolean isMetricMetadata()
IGangliaMessage
true
iff this message contains the metadata for a
metric (the metric declaration).isMetricMetadata
in interface IGangliaMessage
GangliaMessageTypeEnum.METADATA
public GangliaMessageTypeEnum getMetricType()
IGangliaMetadataMessage
getMetricType
in interface IGangliaMetadataMessage
public String getMetricName2()
IGangliaMetadataMessage
getMetricName2
in interface IGangliaMetadataMessage
IGangliaMessage.getMetricName()
public String getUnits()
IGangliaMetadataMessage
getUnits
in interface IGangliaMetadataMessage
public GangliaSlopeEnum getSlope()
IGangliaMetadataMessage
getSlope
in interface IGangliaMetadataMessage
public int getTMax()
IGangliaMetadataMessage
getTMax
in interface IGangliaMetadataMessage
public int getDMax()
IGangliaMetadataMessage
getDMax
in interface IGangliaMetadataMessage
public Map<String,String[]> getExtraValues()
IGangliaMetadataMessage
getExtraValues
in interface IGangliaMetadataMessage
public String[] getGroups()
IGangliaMetadataMessage
IGangliaAttributes.ATTR_TITLE
.getGroups
in interface IGangliaMetadataMessage
null
.public String getTitle()
IGangliaMetadataMessage
IGangliaAttributes.ATTR_TITLE
.getTitle
in interface IGangliaMetadataMessage
IGangliaAttributes.ATTR_TITLE
attribute if
present and otherwise null
.public String getDescription()
IGangliaMetadataMessage
IGangliaAttributes.ATTR_DESC
.getDescription
in interface IGangliaMetadataMessage
IGangliaAttributes.ATTR_DESC
attribute if
present and otherwise null
.public String getFirstValue(String key)
IGangliaMetadataMessage
IGangliaMetadataMessage.getExtraValues()
.getFirstValue
in interface IGangliaMetadataMessage
key
- The key.null
if there are
no values for that key.public boolean equals(Object o)
equals
in class AbstractGangliaMessage
public int hashCode()
hashCode
in class AbstractGangliaMessage
public 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 IGangliaMetadataMessage
value
- 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 IGangliaMetadataMessage
oldValue
- 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.