Class IntervalMetricReader
java.lang.Object
io.opencensus.exporter.metrics.util.IntervalMetricReader
Wrapper of the
MetricReader
which automatically reads and exports the metrics every
export interval.- Since:
- 0.19
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Options forIntervalMetricReader
.private static final class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Duration
private final IntervalMetricReader.Worker
private final Thread
private static final Duration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IntervalMetricReader
create
(MetricExporter metricExporter, MetricReader metricReader, IntervalMetricReader.Options options) Creates a newIntervalMetricReader
.void
Reads and exports data immediately.void
stop()
Stops the worker thread by callingThread.interrupt()
.
-
Field Details
-
DEFAULT_INTERVAL
-
ZERO
-
workerThread
-
worker
-
-
Constructor Details
-
IntervalMetricReader
-
-
Method Details
-
create
public static IntervalMetricReader create(MetricExporter metricExporter, MetricReader metricReader, IntervalMetricReader.Options options) Creates a newIntervalMetricReader
.- Parameters:
metricExporter
- theMetricExporter
to be called after.metricReader
- theMetricReader
to be used to read metrics.options
- theIntervalMetricReader.Options
for the newIntervalMetricReader
.- Returns:
- a new
IntervalMetricReader
. - Since:
- 0.19
-
readAndExportNow
public void readAndExportNow()Reads and exports data immediately.- Since:
- 0.19
-
stop
public void stop()Stops the worker thread by callingThread.interrupt()
.- Since:
- 0.19
-