package gauge
import "go.opentelemetry.io/otel/sdk/metric/aggregator/gauge"
Index ¶
- type Aggregator
- func New() *Aggregator
- func (g *Aggregator) AsNumber() core.Number
- func (g *Aggregator) Collect(ctx context.Context, rec export.MetricRecord, exp export.MetricBatcher)
- func (g *Aggregator) Merge(oa export.MetricAggregator, desc *export.Descriptor)
- func (g *Aggregator) Timestamp() time.Time
- func (g *Aggregator) Update(_ context.Context, number core.Number, rec export.MetricRecord)
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator aggregates gauge events.
func New ¶
func New() *Aggregator
New returns a new gauge aggregator. This aggregator retains the last value and timestamp that were recorded.
func (*Aggregator) AsNumber ¶
func (g *Aggregator) AsNumber() core.Number
AsNumber returns the recorded gauge value as an int64.
func (*Aggregator) Collect ¶
func (g *Aggregator) Collect(ctx context.Context, rec export.MetricRecord, exp export.MetricBatcher)
Collect checkpoints the current value (atomically) and exports it.
func (*Aggregator) Merge ¶
func (g *Aggregator) Merge(oa export.MetricAggregator, desc *export.Descriptor)
func (*Aggregator) Timestamp ¶
func (g *Aggregator) Timestamp() time.Time
Timestamp returns the timestamp of the alst recorded gauge value.
func (*Aggregator) Update ¶
func (g *Aggregator) Update(_ context.Context, number core.Number, rec export.MetricRecord)
Update modifies the current value (atomically) for later export.
Source Files ¶
gauge.go
- Version
- v0.1.0
- Published
- Nov 4, 2019
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 3 hours ago –
Tools for package owners.