T - specific metric descriptor subtypepublic abstract static class MetricDescriptor.MetricDescriptorBuilder<T extends MetricDescriptor> extends Object
MetricDescriptor be
specified during its own construction. Values may also be specified for
the optional arguments needed for a MetricDescriptor, but these
values are defaulted in the event that no value is specified for them.| Modifier and Type | Field and Description |
|---|---|
protected String |
appId |
protected String |
description |
protected boolean |
jmx |
protected String |
name |
protected boolean |
persist |
protected String |
primaryTag |
protected String |
secondaryTag |
protected MetricDescriptor.SummaryIntervalMinutes |
summaryMinutes |
protected MetricDescriptor.Type |
type |
| Constructor and Description |
|---|
MetricDescriptor.MetricDescriptorBuilder(String name)
Creates a new
MetricDescriptor.MetricDescriptorBuilder using only the
arguments that are required to build a valid MetricDescriptor. |
| Modifier and Type | Method and Description |
|---|---|
MetricDescriptor.MetricDescriptorBuilder<T> |
appId(String toSet)
Sets the application ID to apply to the
MetricDescriptor that
will be built. |
abstract T |
build()
Build a
MetricDescriptor subclass instance. |
MetricDescriptor.MetricDescriptorBuilder<T> |
description(String toSet)
Sets the description to apply to the
MetricDescriptor that
will be built. |
MetricDescriptor.MetricDescriptorBuilder<T> |
name(String toSet)
Sets the name to apply to the
MetricDescriptor that will be
built. |
MetricDescriptor.MetricDescriptorBuilder<T> |
persist(boolean toSet)
Sets the flag that indicates whether the
MetricDescriptor
that will be built is to be persisted. |
MetricDescriptor.MetricDescriptorBuilder<T> |
primaryTag(String toSet)
Sets the primary tag (e.g.
|
MetricDescriptor.MetricDescriptorBuilder<T> |
publishToJmx(boolean toSet)
Sets the flag that indicates whether the
MetricDescriptor
that will be built should be made visible via JMX. |
MetricDescriptor.MetricDescriptorBuilder<T> |
secondaryTag(String toSet)
Sets the secondary tag (e.g.
|
MetricDescriptor.MetricDescriptorBuilder<T> |
summaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)
Sets the number of minutes that should elapse between the persistence
of summarized values to apply to the
MetricDescriptor that
will be built. |
MetricDescriptor.MetricDescriptorBuilder<T> |
type(MetricDescriptor.Type toSet)
Sets the metric type to apply to the
MetricDescriptor that
will be built. |
protected boolean jmx
protected boolean persist
protected String appId
protected String description
protected String name
protected String primaryTag
protected String secondaryTag
protected MetricDescriptor.SummaryIntervalMinutes summaryMinutes
protected MetricDescriptor.Type type
public MetricDescriptor.MetricDescriptorBuilder(String name)
MetricDescriptor.MetricDescriptorBuilder using only the
arguments that are required to build a valid MetricDescriptor. If no other fields are set via other methods
before building, the resulting MetricDescriptor will specify
a TimeStampedCounter associated with no specific application,
no primary or secondary tags, no description, and that the resulting
TimeStampedMetric should be persisted using the default
summarization interval and should not be visible via JMX.name - a name for the TimeStampedMetric (e.g.
"txPackets")public MetricDescriptor.MetricDescriptorBuilder<T> appId(String toSet)
MetricDescriptor that
will be built.toSet - application IDpublic abstract T build()
MetricDescriptor subclass instance.MetricDescriptor subclass instancepublic MetricDescriptor.MetricDescriptorBuilder<T> description(String toSet)
MetricDescriptor that
will be built.toSet - descriptionpublic MetricDescriptor.MetricDescriptorBuilder<T> name(String toSet)
MetricDescriptor that will be
built. Many metrics may have the same name (e.g. "txPackets") but
can be distinguished from one another via the primary and secondary
tags specified.toSet - namepublic MetricDescriptor.MetricDescriptorBuilder<T> persist(boolean toSet)
MetricDescriptor
that will be built is to be persisted. true indicates that
the value should be persisted, false that it shouldn't.toSet - persistence flagpublic MetricDescriptor.MetricDescriptorBuilder<T> primaryTag(String toSet)
MetricDescriptor that will be built. The tag can be anything that
is a useful identifier to group metrics by.toSet - primary tagpublic MetricDescriptor.MetricDescriptorBuilder<T> publishToJmx(boolean toSet)
MetricDescriptor
that will be built should be made visible via JMX. true
indicates that the value should be visible, false that it
shouldn't.toSet - JMX flagpublic MetricDescriptor.MetricDescriptorBuilder<T> secondaryTag(String toSet)
MetricDescriptor that will be built. The tag can be anything that
is a useful identifier to group metrics by, but should make sense in
the context of the specified primary tag.toSet - secondary tagpublic MetricDescriptor.MetricDescriptorBuilder<T> summaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)
MetricDescriptor that
will be built.toSet - summarization interval (in minutes)public MetricDescriptor.MetricDescriptorBuilder<T> type(MetricDescriptor.Type toSet)
MetricDescriptor that
will be built.toSet - metric typeCopyright © 2014. All Rights Reserved.