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 classOptions forIntervalMetricReader.private static final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Durationprivate final IntervalMetricReader.Workerprivate final Threadprivate static final Duration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IntervalMetricReadercreate(MetricExporter metricExporter, MetricReader metricReader, IntervalMetricReader.Options options) Creates a newIntervalMetricReader.voidReads and exports data immediately.voidstop()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- theMetricExporterto be called after.metricReader- theMetricReaderto be used to read metrics.options- theIntervalMetricReader.Optionsfor the newIntervalMetricReader.- Returns:
- a new
IntervalMetricReader. - Since:
- 0.19
-
readAndExportNow
public void readAndExportNow()Reads and exports data immediately.- Since:
- 0.19
-
stop
-