Interface MetricStorage
-
- All Known Subinterfaces:
SynchronousMetricStorage
- All Known Implementing Classes:
AsynchronousMetricStorage
,DefaultSynchronousMetricStorage
,EmptyMetricStorage
public interface MetricStorage
Stores collectedMetricData
.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 static Attributes
CARDINALITY_OVERFLOW
Attributes capturing overflow measurements recorded when cardinality limit is exceeded.static int
DEFAULT_MAX_CARDINALITY
The default max number of distinct metric points for a particularMetricStorage
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MetricData
collect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos)
Collects the metrics from this storage.MetricDescriptor
getMetricDescriptor()
Returns a description of the metric produced in this storage.default boolean
isEmpty()
Determines whether this storage is an empty metric storage.
-
-
-
Field Detail
-
DEFAULT_MAX_CARDINALITY
static final int DEFAULT_MAX_CARDINALITY
The default max number of distinct metric points for a particularMetricStorage
.- See Also:
- Constant Field Values
-
CARDINALITY_OVERFLOW
static final Attributes CARDINALITY_OVERFLOW
Attributes capturing overflow measurements recorded when cardinality limit is exceeded.
-
-
Method Detail
-
getMetricDescriptor
MetricDescriptor getMetricDescriptor()
Returns a description of the metric produced in this storage.
-
collect
MetricData collect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos)
Collects the metrics from this storage. If storingAggregationTemporality.DELTA
metrics, reset for the next collection period.Note: This is a stateful operation and will reset any interval-related state for the
collector
.- Parameters:
resource
- The resource associated with the metrics.instrumentationScopeInfo
- The instrumentation scope generating the metrics.startEpochNanos
- The start timestamp for this SDK.epochNanos
- The timestamp for this collection.- Returns:
- The
MetricData
from this collection period.
-
isEmpty
default boolean isEmpty()
Determines whether this storage is an empty metric storage.Uses the reference comparison since
EmptyMetricStorage
is singleton.- Returns:
- true if is empty.
-
-