public static class ConsoleReporter.Builder
extends java.lang.Object
ConsoleReporter
instances. Defaults to using the default locale and
time zone, writing to System.out
, converting rates to events/second, converting
durations to milliseconds, and not filtering metrics.Modifier and Type | Method and Description |
---|---|
ConsoleReporter |
build()
Builds a
ConsoleReporter with the given properties. |
ConsoleReporter.Builder |
convertDurationsTo(java.util.concurrent.TimeUnit durationUnit)
Convert durations to the given time unit.
|
ConsoleReporter.Builder |
convertRatesTo(java.util.concurrent.TimeUnit rateUnit)
Convert rates to the given time unit.
|
ConsoleReporter.Builder |
disabledMetricAttributes(java.util.Set<MetricAttribute> disabledMetricAttributes)
Don't report the passed metric attributes for all metrics (e.g.
|
ConsoleReporter.Builder |
filter(MetricFilter filter)
Only report metrics which match the given filter.
|
ConsoleReporter.Builder |
formattedFor(java.util.Locale locale)
Format numbers for the given
Locale . |
ConsoleReporter.Builder |
formattedFor(java.util.TimeZone timeZone)
Use the given
TimeZone for the time. |
ConsoleReporter.Builder |
outputTo(java.io.PrintStream output)
Write to the given
PrintStream . |
ConsoleReporter.Builder |
scheduleOn(java.util.concurrent.ScheduledExecutorService executor)
Specifies the executor to use while scheduling reporting of metrics.
|
ConsoleReporter.Builder |
shutdownExecutorOnStop(boolean shutdownExecutorOnStop)
Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter.
|
ConsoleReporter.Builder |
withClock(Clock clock)
Use the given
Clock instance for the time. |
public ConsoleReporter.Builder shutdownExecutorOnStop(boolean shutdownExecutorOnStop)
scheduleOn(ScheduledExecutorService)
.shutdownExecutorOnStop
- if true, then executor will be stopped in same time with this reporterthis
public ConsoleReporter.Builder scheduleOn(java.util.concurrent.ScheduledExecutorService executor)
executor
- the executor to use while scheduling reporting of metrics.this
public ConsoleReporter.Builder outputTo(java.io.PrintStream output)
PrintStream
.output
- a PrintStream
instance.this
public ConsoleReporter.Builder formattedFor(java.util.Locale locale)
Locale
.locale
- a Locale
this
public ConsoleReporter.Builder withClock(Clock clock)
Clock
instance for the time.clock
- a Clock
instancethis
public ConsoleReporter.Builder formattedFor(java.util.TimeZone timeZone)
TimeZone
for the time.timeZone
- a TimeZone
this
public ConsoleReporter.Builder convertRatesTo(java.util.concurrent.TimeUnit rateUnit)
rateUnit
- a unit of timethis
public ConsoleReporter.Builder convertDurationsTo(java.util.concurrent.TimeUnit durationUnit)
durationUnit
- a unit of timethis
public ConsoleReporter.Builder filter(MetricFilter filter)
filter
- a MetricFilter
this
public ConsoleReporter.Builder disabledMetricAttributes(java.util.Set<MetricAttribute> disabledMetricAttributes)
MetricAttribute
.disabledMetricAttributes
- a MetricFilter
this
public ConsoleReporter build()
ConsoleReporter
with the given properties.ConsoleReporter
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"