Class EmptyMetricStorage
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.state.EmptyMetricStorage
-
- All Implemented Interfaces:
MetricStorage,SynchronousMetricStorage,WriteableMetricStorage
final class EmptyMetricStorage extends java.lang.Object implements SynchronousMetricStorage
-
-
Field Summary
Fields Modifier and Type Field Description private MetricDescriptordescriptor(package private) static EmptyMetricStorageINSTANCE-
Fields inherited from interface io.opentelemetry.sdk.metrics.internal.state.MetricStorage
CARDINALITY_OVERFLOW, DEFAULT_MAX_CARDINALITY
-
-
Constructor Summary
Constructors Modifier Constructor Description privateEmptyMetricStorage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricDatacollect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos)Collects the metrics from this storage.MetricDescriptorgetMetricDescriptor()Returns a description of the metric produced in this storage.booleanisEnabled()Returnstrueif the storage is actively recording measurements, andfalseotherwise (i.e.voidrecordDouble(double value, Attributes attributes, Context context)Records a measurement.voidrecordLong(long value, Attributes attributes, Context context)Records a measurement.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.sdk.metrics.internal.state.MetricStorage
isEmpty
-
-
-
-
Field Detail
-
INSTANCE
static final EmptyMetricStorage INSTANCE
-
descriptor
private final MetricDescriptor descriptor
-
-
Method Detail
-
getMetricDescriptor
public MetricDescriptor getMetricDescriptor()
Description copied from interface:MetricStorageReturns a description of the metric produced in this storage.- Specified by:
getMetricDescriptorin interfaceMetricStorage
-
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.
-
recordLong
public void recordLong(long value, Attributes attributes, Context context)Description copied from interface:WriteableMetricStorageRecords a measurement.- Specified by:
recordLongin interfaceWriteableMetricStorage
-
recordDouble
public void recordDouble(double value, Attributes attributes, Context context)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
-
-