Package io.dropwizard.metrics.common
Class BaseReporterFactory
- java.lang.Object
-
- io.dropwizard.metrics.common.BaseReporterFactory
-
- All Implemented Interfaces:
Discoverable
,ReporterFactory
- Direct Known Subclasses:
BaseFormattedReporterFactory
,GraphiteReporterFactory
,Slf4jReporterFactory
public abstract class BaseReporterFactory extends Object implements ReporterFactory
A baseReporterFactory
for configuring metric reporters. Configures options common to allScheduledReporter
s. Configuration Parameters:Name Default Description durationUnit milliseconds The unit to report durations as. Overrides per-metric duration units. rateUnit seconds The unit to report rates as. Overrides per-metric rate units. excludes No excluded metrics. Metrics to exclude from reports, by name. When defined, matching metrics will not be reported. See getFilter()
.includes All metrics included. Metrics to include in reports, by name. When defined, only these metrics will be reported. See getFilter()
. Exclusion rules (excludes) take precedence, so if a name matches both excludes and includes, it is excluded.excludesAttributes No excluded attributes. Metric attributes to exclude from reports, by name (e.g `p98`, `m15_rate`, `stddev`). When defined, matching metrics attributes will not be reported. See MetricAttribute
includesAttributes All metrics attributes. Metrics attributes to include in reports, by name (e.g `p98`, `m15_rate`, `stddev`). When defined, only these attributes will be reported. See MetricAttribute
. Exclusion rules (excludes) take precedence, so if an attribute matches both includesAttributes and excludesAttributes, it is excluded.useRegexFilters false Indicates whether the values of the 'includes' and 'excludes' fields should be treated as regular expressions or not. frequency none The frequency to report metrics. Overrides the default
.
-
-
Constructor Summary
Constructors Constructor Description BaseReporterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<com.codahale.metrics.MetricAttribute>
getDisabledAttributes()
TimeUnit
getDurationUnit()
Set<String>
getExcludes()
EnumSet<com.codahale.metrics.MetricAttribute>
getExcludesAttributes()
com.codahale.metrics.MetricFilter
getFilter()
Gets aMetricFilter
that specifically includes and excludes configured metrics.Optional<Duration>
getFrequency()
Returns the frequency for reporting metrics.Set<String>
getIncludes()
EnumSet<com.codahale.metrics.MetricAttribute>
getIncludesAttributes()
TimeUnit
getRateUnit()
boolean
getUseRegexFilters()
boolean
getUseSubstringMatching()
void
setDurationUnit(TimeUnit durationUnit)
void
setExcludes(Set<String> excludes)
void
setExcludesAttributes(EnumSet<com.codahale.metrics.MetricAttribute> excludesAttributes)
void
setFrequency(Optional<Duration> frequency)
void
setIncludes(Set<String> includes)
void
setIncludesAttributes(EnumSet<com.codahale.metrics.MetricAttribute> includesAttributes)
void
setRateUnit(TimeUnit rateUnit)
void
setUseRegexFilters(boolean useRegexFilters)
void
setUseSubstringMatching(boolean useSubstringMatching)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.dropwizard.metrics.common.ReporterFactory
build
-
-
-
-
Method Detail
-
getDurationUnit
public TimeUnit getDurationUnit()
-
setDurationUnit
public void setDurationUnit(TimeUnit durationUnit)
-
getRateUnit
public TimeUnit getRateUnit()
-
setRateUnit
public void setRateUnit(TimeUnit rateUnit)
-
getFrequency
public Optional<Duration> getFrequency()
Description copied from interface:ReporterFactory
Returns the frequency for reporting metrics.- Specified by:
getFrequency
in interfaceReporterFactory
- Returns:
- the frequency for reporting metrics.
-
getUseRegexFilters
public boolean getUseRegexFilters()
-
setUseRegexFilters
public void setUseRegexFilters(boolean useRegexFilters)
-
getUseSubstringMatching
public boolean getUseSubstringMatching()
-
setUseSubstringMatching
public void setUseSubstringMatching(boolean useSubstringMatching)
-
getExcludesAttributes
public EnumSet<com.codahale.metrics.MetricAttribute> getExcludesAttributes()
-
setExcludesAttributes
public void setExcludesAttributes(EnumSet<com.codahale.metrics.MetricAttribute> excludesAttributes)
-
getIncludesAttributes
public EnumSet<com.codahale.metrics.MetricAttribute> getIncludesAttributes()
-
setIncludesAttributes
public void setIncludesAttributes(EnumSet<com.codahale.metrics.MetricAttribute> includesAttributes)
-
getFilter
public com.codahale.metrics.MetricFilter getFilter()
Gets aMetricFilter
that specifically includes and excludes configured metrics. Filtering works in 4 ways:- unfiltered
- All metrics are reported
- excludes-only
- All metrics are reported, except those whose name is listed in excludes.
- includes-only
- Only metrics whose name is listed in includes are reported.
- mixed (both includes and excludes
- Only metrics whose name is listed in includes and not listed in excludes are reported; excludes takes precedence over includes.
- Returns:
- the filter for selecting metrics based on the configured excludes/includes.
- See Also:
getIncludes()
,getExcludes()
-
getDisabledAttributes
protected Set<com.codahale.metrics.MetricAttribute> getDisabledAttributes()
-
-