public abstract class MetricDescriptor extends Object implements Comparable<MetricDescriptor>
TimeStampedMetric
object.Modifier and Type | Class and Description |
---|---|
static class |
MetricDescriptor.MetricDescriptorBuilder<T extends MetricDescriptor>
Metric descriptor builder object, which requires that only arguments that
are mandatory for the construction of a
MetricDescriptor be
specified during its own construction. |
static class |
MetricDescriptor.SummaryIntervalMinutes
The set of permitted values for the interval that can elapse between
summarizations of a
TimeStampedMetric value. |
static class |
MetricDescriptor.Type
The set of permitted values for
TimeStampedMetric types. |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TAG
The default tag used internally
|
Modifier | Constructor and Description |
---|---|
protected |
MetricDescriptor(MetricDescriptor.Type type,
String appId,
String name,
String primaryTag,
String secondaryTag,
String description,
boolean persist,
MetricDescriptor.SummaryIntervalMinutes minutes,
boolean jmx)
Creates a new
MetricDescriptor that can subsequently be used when
creating a new TimeStampedMetric . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MetricDescriptor toCompare) |
boolean |
equals(Object toCompare) |
String |
getAppId()
Gets the application ID associated with the
TimeStampedMetric ,
presumably the ID of the application that requested the TimeStampedMetric 's creation. |
String |
getDescription()
Gets the description of the
TimeStampedMetric . |
String |
getName()
Gets the name of the
TimeStampedMetric . |
boolean |
getPersist()
Gets the flag that indicates whether the
TimeStampedMetric value
is to be persisted. |
String |
getPrimaryTag()
Gets the primary tag for the
TimeStampedMetric . |
boolean |
getPublishToJmx()
Gets the flag that indicates whether the
TimeStampedMetric value
should be made visible via JMX. |
String |
getSecondaryTag()
Gets the secondary tag for the
TimeStampedMetric . |
MetricDescriptor.SummaryIntervalMinutes |
getSummaryMinutes()
Gets the number of minutes that should elapse between the persistence of
summarized values for the
TimeStampedMetric . |
MetricDescriptor.Type |
getType()
Gets the metric type for the
TimeStampedMetric . |
int |
hashCode() |
void |
setAppId(String toSet)
Sets the application ID associated with the
TimeStampedMetric ,
presumably the ID of the application that requested the TimeStampedMetric 's creation. |
void |
setSummaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)
Sets the number of minutes that should elapse between the persistence of
summarized values for the
TimeStampedMetric . |
String |
toDebugString()
Gets a detailed representation of this object to facilitate debugging.
|
String |
toString() |
String |
uniqueName()
Produces a name built from the combination of fields, sans application
ID, that uniquely distinguish the
TimeStampedMetric described by
this object from other TimeStampedMetric s. |
public static final String DEFAULT_TAG
protected MetricDescriptor(MetricDescriptor.Type type, String appId, String name, String primaryTag, String secondaryTag, String description, boolean persist, MetricDescriptor.SummaryIntervalMinutes minutes, boolean jmx)
MetricDescriptor
that can subsequently be used when
creating a new TimeStampedMetric
.type
- the metric typeappId
- an application ID that the TimeStampedMetric
should
be associated withname
- a name for the TimeStampedMetric
(e.g. "txPackets")primaryTag
- the primary tag for the TimeStampedMetric
(e.g. "router-1.2.3.4")secondaryTag
- the secondary tag for the TimeStampedMetric
(e.g. "port1")description
- a description for the TimeStampedMetric
persist
- whether the TimeStampedMetric
should be persistedminutes
- the number of minutes that should elapse between
summarizations of the TimeStampedMetric
valuejmx
- whether the TimeStampedMetric
value should be
visible via JMXIllegalArgumentException
- if a null value is supplied for either
the type or name parameterspublic int compareTo(MetricDescriptor toCompare)
compareTo
in interface Comparable<MetricDescriptor>
public String getAppId()
TimeStampedMetric
,
presumably the ID of the application that requested the TimeStampedMetric
's creation.public String getDescription()
TimeStampedMetric
.public String getName()
TimeStampedMetric
.public boolean getPersist()
TimeStampedMetric
value
is to be persisted.public String getPrimaryTag()
TimeStampedMetric
.public boolean getPublishToJmx()
TimeStampedMetric
value
should be made visible via JMX.public String getSecondaryTag()
TimeStampedMetric
.public MetricDescriptor.SummaryIntervalMinutes getSummaryMinutes()
TimeStampedMetric
.public MetricDescriptor.Type getType()
TimeStampedMetric
.public void setAppId(String toSet)
TimeStampedMetric
,
presumably the ID of the application that requested the TimeStampedMetric
's creation. Any white space in the specified ID will
be stripped.toSet
- application IDpublic void setSummaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)
TimeStampedMetric
.toSet
- summarization interval (in minutes)public String toDebugString()
public String uniqueName()
TimeStampedMetric
described by
this object from other TimeStampedMetric
s.Copyright © 2015. All Rights Reserved.