Class PeriodicMetricReaderBuilder
java.lang.Object
io.opentelemetry.sdk.metrics.export.PeriodicMetricReaderBuilder
Builder for
PeriodicMetricReader.- Since:
- 1.14.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final longprivate ScheduledExecutorServiceprivate longprivate final MetricExporter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build aPeriodicMetricReaderwith the configuration of this builder.setExecutor(ScheduledExecutorService executor) Sets theScheduledExecutorServiceto schedule reads on.setInterval(long interval, TimeUnit unit) Sets the interval of reads.setInterval(Duration interval) Sets the interval of reads.
-
Field Details
-
DEFAULT_SCHEDULE_DELAY_MINUTES
static final long DEFAULT_SCHEDULE_DELAY_MINUTES- See Also:
-
metricExporter
-
intervalNanos
private long intervalNanos -
executor
-
-
Constructor Details
-
PeriodicMetricReaderBuilder
PeriodicMetricReaderBuilder(MetricExporter metricExporter)
-
-
Method Details
-
setInterval
Sets the interval of reads. If unset, defaults to 1Lmin. -
setInterval
Sets the interval of reads. If unset, defaults to 1Lmin. -
setExecutor
Sets theScheduledExecutorServiceto schedule reads on. -
build
Build aPeriodicMetricReaderwith the configuration of this builder.
-