Class EmptyMetricStorage
java.lang.Object
io.opentelemetry.sdk.metrics.internal.state.EmptyMetricStorage
- All Implemented Interfaces:
MetricStorage
,SynchronousMetricStorage
,WriteableMetricStorage
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MetricDescriptor
(package private) static final EmptyMetricStorage
Fields inherited from interface io.opentelemetry.sdk.metrics.internal.state.MetricStorage
CARDINALITY_OVERFLOW, DEFAULT_MAX_CARDINALITY
-
Constructor Summary
Constructors -
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.boolean
Returnstrue
if the storage is actively recording measurements, andfalse
otherwise (i.e.void
recordDouble
(double value, Attributes attributes, Context context) Records a measurement.void
recordLong
(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 Details
-
INSTANCE
-
descriptor
-
-
Constructor Details
-
EmptyMetricStorage
private EmptyMetricStorage()
-
-
Method Details
-
getMetricDescriptor
Description copied from interface:MetricStorage
Returns a description of the metric produced in this storage.- Specified by:
getMetricDescriptor
in interfaceMetricStorage
-
collect
public MetricData collect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos) Description copied from interface:MetricStorage
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
.- Specified by:
collect
in 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
MetricData
from this collection period.
-
recordLong
Description copied from interface:WriteableMetricStorage
Records a measurement.- Specified by:
recordLong
in interfaceWriteableMetricStorage
-
recordDouble
Description copied from interface:WriteableMetricStorage
Records a measurement.- Specified by:
recordDouble
in interfaceWriteableMetricStorage
-
isEnabled
public boolean isEnabled()Description copied from interface:WriteableMetricStorage
Returnstrue
if the storage is actively recording measurements, andfalse
otherwise (i.e. noop / empty metric storage is installed).- Specified by:
isEnabled
in interfaceWriteableMetricStorage
-