Debian Codegraph @

pdata/pmetric/aggregation_temporality.go

raw symbols SCIP
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric"
5
6 import (
7 "go.opentelemetry.io/collector/pdata/internal"
8 )
9
10 // AggregationTemporality defines how a metric aggregator reports aggregated values.
11 // It describes how those values relate to the time interval over which they are aggregated.
12 type AggregationTemporality int32
13
14 const (
15 // AggregationTemporalityUnspecified is the default AggregationTemporality, it MUST NOT be used.
16 AggregationTemporalityUnspecified = AggregationTemporality(internal.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED)
17 // AggregationTemporalityDelta is a AggregationTemporality for a metric aggregator which reports changes since last report time.
18 AggregationTemporalityDelta = AggregationTemporality(internal.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA)
19 // AggregationTemporalityCumulative is a AggregationTemporality for a metric aggregator which reports changes since a fixed start time.
20 AggregationTemporalityCumulative = AggregationTemporality(internal.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE)
21 )
22
23 // String returns the string representation of the AggregationTemporality.
24 func (at AggregationTemporality) String() string {
25 switch at {
26 case AggregationTemporalityUnspecified:
27 return "Unspecified"
28 case AggregationTemporalityDelta:
29 return "Delta"
30 case AggregationTemporalityCumulative:
31 return "Cumulative"
32 }
33 return ""
34 }