org.apache.hadoop.metrics2
usage.@Deprecated @InterfaceAudience.Private @InterfaceStability.Evolving public interface MetricsRecord
update()
to pass the record to the
client library.
Metric data is not immediately sent to the metrics system
each time that update()
is called.
An internal table is maintained, identified by the record name. This
table has columns
corresponding to the tag and the metric names, and rows
corresponding to each unique set of tag values. An update
either modifies an existing row in the table, or adds a new row with a set of
tag values that are different from all the other rows. Note that if there
are no tags, then there can be at most one row in the table.
Once a row is added to the table, its data will be sent to the metrics system
on every timer period, whether or not it has been updated since the previous
timer period. If this is inappropriate, for example if metrics were being
reported by some transient object in an application, the remove()
method can be used to remove the row and thus stop the data from being
sent.
Note that the update()
method is atomic. This means that it is
safe for different threads to be updating the same metric. More precisely,
it is OK for different threads to call update()
on MetricsRecord instances
with the same set of tag names and tag values. Different threads should
not use the same MetricsRecord instance at the same time.限定符和类型 | 方法和说明 |
---|---|
String |
getRecordName()
已过时。
Returns the record name.
|
void |
incrMetric(String metricName,
byte metricValue)
已过时。
Increments the named metric by the specified value.
|
void |
incrMetric(String metricName,
float metricValue)
已过时。
Increments the named metric by the specified value.
|
void |
incrMetric(String metricName,
int metricValue)
已过时。
Increments the named metric by the specified value.
|
void |
incrMetric(String metricName,
long metricValue)
已过时。
Increments the named metric by the specified value.
|
void |
incrMetric(String metricName,
short metricValue)
已过时。
Increments the named metric by the specified value.
|
void |
remove()
已过时。
Removes, from the buffered data table, all rows having tags
that equal the tags that have been set on this record.
|
void |
removeTag(String tagName)
已过时。
Removes any tag of the specified name.
|
void |
setMetric(String metricName,
byte metricValue)
已过时。
Sets the named metric to the specified value.
|
void |
setMetric(String metricName,
float metricValue)
已过时。
Sets the named metric to the specified value.
|
void |
setMetric(String metricName,
int metricValue)
已过时。
Sets the named metric to the specified value.
|
void |
setMetric(String metricName,
long metricValue)
已过时。
Sets the named metric to the specified value.
|
void |
setMetric(String metricName,
short metricValue)
已过时。
Sets the named metric to the specified value.
|
void |
setTag(String tagName,
byte tagValue)
已过时。
Sets the named tag to the specified value.
|
void |
setTag(String tagName,
int tagValue)
已过时。
Sets the named tag to the specified value.
|
void |
setTag(String tagName,
long tagValue)
已过时。
Sets the named tag to the specified value.
|
void |
setTag(String tagName,
short tagValue)
已过时。
Sets the named tag to the specified value.
|
void |
setTag(String tagName,
String tagValue)
已过时。
Sets the named tag to the specified value.
|
void |
update()
已过时。
Updates the table of buffered data which is to be sent periodically.
|
String getRecordName()
void setTag(String tagName, String tagValue)
tagName
- name of the tagtagValue
- new value of the tagMetricsException
- if the tagName conflicts with the configurationvoid setTag(String tagName, int tagValue)
tagName
- name of the tagtagValue
- new value of the tagMetricsException
- if the tagName conflicts with the configurationvoid setTag(String tagName, long tagValue)
tagName
- name of the tagtagValue
- new value of the tagMetricsException
- if the tagName conflicts with the configurationvoid setTag(String tagName, short tagValue)
tagName
- name of the tagtagValue
- new value of the tagMetricsException
- if the tagName conflicts with the configurationvoid setTag(String tagName, byte tagValue)
tagName
- name of the tagtagValue
- new value of the tagMetricsException
- if the tagName conflicts with the configurationvoid removeTag(String tagName)
tagName
- name of a tagvoid setMetric(String metricName, int metricValue)
metricName
- name of the metricmetricValue
- new value of the metricMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid setMetric(String metricName, long metricValue)
metricName
- name of the metricmetricValue
- new value of the metricMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid setMetric(String metricName, short metricValue)
metricName
- name of the metricmetricValue
- new value of the metricMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid setMetric(String metricName, byte metricValue)
metricName
- name of the metricmetricValue
- new value of the metricMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid setMetric(String metricName, float metricValue)
metricName
- name of the metricmetricValue
- new value of the metricMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid incrMetric(String metricName, int metricValue)
metricName
- name of the metricmetricValue
- incremental valueMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid incrMetric(String metricName, long metricValue)
metricName
- name of the metricmetricValue
- incremental valueMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid incrMetric(String metricName, short metricValue)
metricName
- name of the metricmetricValue
- incremental valueMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid incrMetric(String metricName, byte metricValue)
metricName
- name of the metricmetricValue
- incremental valueMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid incrMetric(String metricName, float metricValue)
metricName
- name of the metricmetricValue
- incremental valueMetricsException
- if the metricName or the type of the metricValue
conflicts with the configurationvoid update()
void remove()
Copyright © 2009 The Apache Software Foundation