Class MetricData
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.data.MetricData
-
@Immutable public abstract class MetricData extends java.lang.ObjectAMetricDatarepresents the data exported as part of aggregating oneInstrument.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetricData.DoublePointDoublePoint is a single data point in a timeseries that describes the time-varying value of a double metric.static classMetricData.LongPointLongPoint is a single data point in a timeseries that describes the time-varying values of a int64 metric.static classMetricData.Pointstatic classMetricData.SummaryPointSummaryPoint is a single data point that summarizes the values in a time series of numeric values.static classMetricData.TypeThe kind of metric.static classMetricData.ValueAtPercentile
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MetricDatacreate(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, java.lang.String name, java.lang.String description, java.lang.String unit, MetricData.Type type, java.util.Collection<MetricData.Point> points)abstract java.lang.StringgetDescription()Returns the description of this metric.abstract io.opentelemetry.sdk.common.InstrumentationLibraryInfogetInstrumentationLibraryInfo()Returns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.abstract java.lang.StringgetName()Returns the metric name.abstract java.util.Collection<MetricData.Point>getPoints()Returns the dataMetricData.Points for this metric.abstract io.opentelemetry.sdk.resources.ResourcegetResource()Returns the resource of thisMetricData.abstract MetricData.TypegetType()Returns the type of this metric.abstract java.lang.StringgetUnit()Returns the unit of this metric.
-
-
-
Method Detail
-
getResource
public abstract io.opentelemetry.sdk.resources.Resource getResource()
Returns the resource of thisMetricData.- Returns:
- the resource of this
MetricData.
-
getInstrumentationLibraryInfo
public abstract io.opentelemetry.sdk.common.InstrumentationLibraryInfo getInstrumentationLibraryInfo()
Returns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.- Returns:
- an instance of
InstrumentationLibraryInfo
-
getName
public abstract java.lang.String getName()
Returns the metric name.- Returns:
- the metric name.
-
getDescription
public abstract java.lang.String getDescription()
Returns the description of this metric.- Returns:
- the description of this metric.
-
getUnit
public abstract java.lang.String getUnit()
Returns the unit of this metric.- Returns:
- the unit of this metric.
-
getType
public abstract MetricData.Type getType()
Returns the type of this metric.- Returns:
- the type of this metric.
-
getPoints
public abstract java.util.Collection<MetricData.Point> getPoints()
Returns the dataMetricData.Points for this metric.Only one type of points are available at any moment for a
MetricData, and the type is determined by theMetricData.Type.- Returns:
- the data
MetricData.Points for this metric, or emptyCollectionif no points.
-
create
public static MetricData create(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, java.lang.String name, java.lang.String description, java.lang.String unit, MetricData.Type type, java.util.Collection<MetricData.Point> points)
-
-