Class DefaultSynchronousMetricStorage<T extends PointData, U extends ExemplarData>
java.lang.Object
io.opentelemetry.sdk.metrics.internal.state.DefaultSynchronousMetricStorage<T,U>
- All Implemented Interfaces:
MetricStorage, SynchronousMetricStorage, WriteableMetricStorage
public final class DefaultSynchronousMetricStorage<T extends PointData, U extends ExemplarData>
extends Object
implements SynchronousMetricStorage
Stores aggregated
MetricData for synchronous instruments.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
Fields inherited from interface MetricStorage
CARDINALITY_OVERFLOW, DEFAULT_MAX_CARDINALITY -
Method Summary
Modifier and TypeMethodDescriptioncollect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos) Collects the metrics from this storage.Returns a description of the metric produced in this storage.booleanReturnstrueif the storage is actively recording measurements, andfalseotherwise (i.e. noop / empty metric storage is installed).voidrecordDouble(double value, Attributes attributes, Context context) Records a measurement.voidrecordLong(long value, Attributes attributes, Context context) Records a measurement.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MetricStorage
isEmpty
-
Method Details
-
recordLong
Description copied from interface:WriteableMetricStorageRecords a measurement.- Specified by:
recordLongin interfaceWriteableMetricStorage
-
recordDouble
Description copied from interface:WriteableMetricStorageRecords a measurement.- Specified by:
recordDoublein interfaceWriteableMetricStorage
-
isEnabled
public boolean isEnabled()Description copied from interface:WriteableMetricStorageReturnstrueif the storage is actively recording measurements, andfalseotherwise (i.e. noop / empty metric storage is installed).- Specified by:
isEnabledin interfaceWriteableMetricStorage
-
collect
public MetricData collect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos) Description copied from interface:MetricStorageCollects the metrics from this storage. If storingAggregationTemporality.DELTAmetrics, reset for the next collection period.Note: This is a stateful operation and will reset any interval-related state for the
collector.- Specified by:
collectin interfaceMetricStorage- 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
MetricDatafrom this collection period.
-
getMetricDescriptor
Description copied from interface:MetricStorageReturns a description of the metric produced in this storage.- Specified by:
getMetricDescriptorin interfaceMetricStorage
-