Class MetricReader
- java.lang.Object
-
- io.opencensus.exporter.metrics.util.MetricReader
-
public class MetricReader extends java.lang.ObjectHelper class to read all availableMetrics from aMetricProducerManagerand exports them to aMetricExporter.- Since:
- 0.19
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetricReader.OptionsOptions forMetricReader.
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringDEFAULT_SPAN_NAMEprivate static java.util.logging.Loggerloggerprivate MetricProducerManagermetricProducerManagerprivate static SamplerprobabilitySamplerprivate java.lang.StringspanNameprivate static Tracertracer
-
Constructor Summary
Constructors Modifier Constructor Description privateMetricReader(MetricProducerManager metricProducerManager, java.lang.String spanName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetricReadercreate(MetricReader.Options options)Creates a newMetricReader.private static java.lang.StringexceptionMessage(java.lang.Throwable e)voidreadAndExport(MetricExporter metricExporter)Reads the metrics from theMetricProducerManagerand 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 theMetricProducerManagerand 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)
-
-