Debian Codegraph @

pdata/pprofile/aggregation_temporality.go

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