Class MetricReader
- java.lang.Object
-
- io.opencensus.exporter.metrics.util.MetricReader
-
public class MetricReader extends java.lang.Object
Helper class to read all availableMetric
s from aMetricProducerManager
and exports them to aMetricExporter
.- Since:
- 0.19
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetricReader.Options
Options forMetricReader
.
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
DEFAULT_SPAN_NAME
private static java.util.logging.Logger
logger
private MetricProducerManager
metricProducerManager
private static Sampler
probabilitySampler
private java.lang.String
spanName
private static Tracer
tracer
-
Constructor Summary
Constructors Modifier Constructor Description private
MetricReader(MetricProducerManager metricProducerManager, java.lang.String spanName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetricReader
create(MetricReader.Options options)
Creates a newMetricReader
.private static java.lang.String
exceptionMessage(java.lang.Throwable e)
void
readAndExport(MetricExporter metricExporter)
Reads the metrics from theMetricProducerManager
and exports them to themetricExporter
.
-
-
-
Field Detail
-
tracer
private static final Tracer tracer
-
logger
private static final java.util.logging.Logger logger
-
probabilitySampler
private static final Sampler probabilitySampler
-
DEFAULT_SPAN_NAME
static final java.lang.String DEFAULT_SPAN_NAME
- See Also:
- Constant Field Values
-
metricProducerManager
private final MetricProducerManager metricProducerManager
-
spanName
private final java.lang.String spanName
-
-
Constructor Detail
-
MetricReader
private MetricReader(MetricProducerManager metricProducerManager, java.lang.String spanName)
-
-
Method Detail
-
create
public static MetricReader create(MetricReader.Options options)
Creates a newMetricReader
.- Parameters:
options
- the options forMetricReader
.- Returns:
- a new
MetricReader
. - Since:
- 0.19
-
readAndExport
public void readAndExport(MetricExporter metricExporter)
Reads the metrics from theMetricProducerManager
and exports them to themetricExporter
.- Parameters:
metricExporter
- the exporter called to export the metrics read.- Since:
- 0.19
-
exceptionMessage
private static java.lang.String exceptionMessage(java.lang.Throwable e)
-
-