| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
//go:generate stringer -type=Temporality |
| 5 |
|
| 6 |
package metricdata // import "go.opentelemetry.io/otel/sdk/metric/metricdata" |
| 7 |
|
| 8 |
// Temporality defines the window that an aggregation was calculated over. |
| 9 |
type Temporality uint8 |
| 10 |
|
| 11 |
const ( |
| 12 |
// undefinedTemporality represents an unset Temporality. |
| 13 |
//nolint:unused |
| 14 |
undefinedTemporality Temporality = iota |
| 15 |
|
| 16 |
// CumulativeTemporality defines a measurement interval that continues to |
| 17 |
// expand forward in time from a starting point. New measurements are |
| 18 |
// added to all previous measurements since a start time. |
| 19 |
CumulativeTemporality |
| 20 |
|
| 21 |
// DeltaTemporality defines a measurement interval that resets each cycle. |
| 22 |
// Measurements from one cycle are recorded independently, measurements |
| 23 |
// from other cycles do not affect them. |
| 24 |
DeltaTemporality |
| 25 |
) |
| 26 |
|
| 27 |
// MarshalText returns the byte encoded of t. |
| 28 |
func (t Temporality) MarshalText() ([]byte, error) { |
| 29 |
return []byte(t.String()), nil |
| 30 |
} |