Class RegisteredReader
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.export.RegisteredReader
-
public class RegisteredReader extends java.lang.Object
Represents aMetricReader
registered withSdkMeterProvider
.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Field Summary
Fields Modifier and Type Field Description private int
id
private static java.util.concurrent.atomic.AtomicInteger
ID_COUNTER
private long
lastCollectEpochNanos
private MetricReader
metricReader
private ViewRegistry
viewRegistry
-
Constructor Summary
Constructors Modifier Constructor Description private
RegisteredReader(MetricReader metricReader, ViewRegistry viewRegistry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RegisteredReader
create(MetricReader reader, ViewRegistry viewRegistry)
Construct a new collection info object storing information for collection against a reader.boolean
equals(java.lang.Object o)
long
getLastCollectEpochNanos()
Get the time of the last collection for the reader.MetricReader
getReader()
ViewRegistry
getViewRegistry()
Get theViewRegistry
for the reader.int
hashCode()
void
setLastCollectEpochNanos(long epochNanos)
Set the time the last collection took place for the reader.java.lang.String
toString()
-
-
-
Field Detail
-
ID_COUNTER
private static final java.util.concurrent.atomic.AtomicInteger ID_COUNTER
-
id
private final int id
-
metricReader
private final MetricReader metricReader
-
viewRegistry
private final ViewRegistry viewRegistry
-
lastCollectEpochNanos
private volatile long lastCollectEpochNanos
-
-
Constructor Detail
-
RegisteredReader
private RegisteredReader(MetricReader metricReader, ViewRegistry viewRegistry)
-
-
Method Detail
-
create
public static RegisteredReader create(MetricReader reader, ViewRegistry viewRegistry)
Construct a new collection info object storing information for collection against a reader.
-
getReader
public MetricReader getReader()
-
setLastCollectEpochNanos
public void setLastCollectEpochNanos(long epochNanos)
Set the time the last collection took place for the reader.Called by
SdkMeterProvider
'sMetricProducer
after collection.
-
getLastCollectEpochNanos
public long getLastCollectEpochNanos()
Get the time of the last collection for the reader.Used to compute the
PointData.getStartEpochNanos()
for instruments aggregations withAggregationTemporality.DELTA
temporality.
-
getViewRegistry
public ViewRegistry getViewRegistry()
Get theViewRegistry
for the reader.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-