public static class RollingCounterDescriptor.RollingCounterDescriptorBuilder extends MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
RollingCounterDescriptor
be specified during its own construction.
Values may also be specified for the optional arguments needed for a
RollingCounterDescriptor
, but these values are defaulted in the
event that no value is specified for them.appId, description, jmx, name, persist, primaryTag, secondaryTag, summaryMinutes, type
Constructor and Description |
---|
RollingCounterDescriptorBuilder(String name)
Creates a new
RollingCounterDescriptor.RollingCounterDescriptorBuilder using only the
arguments that are required to build a valid RollingCounterDescriptor . |
public RollingCounterDescriptorBuilder(String name)
RollingCounterDescriptor.RollingCounterDescriptorBuilder
using only the
arguments that are required to build a valid RollingCounterDescriptor
. If no other fields are set via other
methods before building, the resulting RollingCounterDescriptor
will specify a TimeStampedRollingCounter
associated with no specific application,
no primary or secondary tags, no description, no priming value, and
that the resulting TimeStampedRollingCounter
should be
persisted using the default summarization interval and should not be
visible via JMX.name
- a name for the TimeStampedRollingCounter
(e.g.
"txPackets")public RollingCounterDescriptor build()
RollingCounterDescriptor
instance.build
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
RollingCounterDescriptor
public RollingCounterDescriptor.RollingCounterDescriptorBuilder appId(String toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that
will be built.appId
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- application IDpublic RollingCounterDescriptor.RollingCounterDescriptorBuilder description(String toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that
will be built.description
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- descriptionpublic RollingCounterDescriptor.RollingCounterDescriptorBuilder name(String toSet)
MetricDescriptor.MetricDescriptorBuilder
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.name
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- namepublic RollingCounterDescriptor.RollingCounterDescriptorBuilder persist(boolean toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that will be built is to be persisted. true
indicates that
the value should be persisted, false
that it shouldn't.persist
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- persistence flagpublic RollingCounterDescriptor.RollingCounterDescriptorBuilder primaryTag(String toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that will be built. The tag can be anything that
is a useful identifier to group metrics by.primaryTag
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- primary tagpublic RollingCounterDescriptor.RollingCounterDescriptorBuilder primingValue(Long toSet)
RollingCounterDescriptor
that will be built. This is the value that
will be used initially to compute a delta for the TimeStampedRollingCounter
; if no value is provided then the first
update of the TimeStampedRollingCounter
will be used as a
priming value.toSet
- priming valuepublic RollingCounterDescriptor.RollingCounterDescriptorBuilder publishToJmx(boolean toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that will be built should be made visible via JMX. true
indicates that the value should be visible, false
that it
shouldn't.publishToJmx
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- JMX flagpublic RollingCounterDescriptor.RollingCounterDescriptorBuilder secondaryTag(String toSet)
MetricDescriptor.MetricDescriptorBuilder
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.secondaryTag
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- secondary tagpublic RollingCounterDescriptor.RollingCounterDescriptorBuilder summaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that
will be built.summaryMinutes
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- summarization interval (in minutes)public RollingCounterDescriptor.RollingCounterDescriptorBuilder type(MetricDescriptor.Type toSet)
MetricDescriptor.MetricDescriptorBuilder
MetricDescriptor
that
will be built.type
in class MetricDescriptor.MetricDescriptorBuilder<RollingCounterDescriptor>
toSet
- metric typeCopyright © 2016. All Rights Reserved.