stats

package
v1.68.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package stats provides internal stats related functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLabels

func SetLabels(ctx context.Context, labels *Labels) context.Context

SetLabels sets the Labels in the context.

Types

type Labels

type Labels struct {
	// TelemetryLabels are the telemetry labels to record.
	TelemetryLabels map[string]string
}

Labels are the labels for metrics.

func GetLabels

func GetLabels(ctx context.Context) *Labels

GetLabels returns the Labels stored in the context, or nil if there is one.

type MetricsRecorderList added in v1.66.0

type MetricsRecorderList struct {
	// contains filtered or unexported fields
}

MetricsRecorderList forwards Record calls to all of its metricsRecorders.

It eats any record calls where the label values provided do not match the number of label keys.

func NewMetricsRecorderList added in v1.66.0

func NewMetricsRecorderList(shs []stats.Handler) *MetricsRecorderList

NewMetricsRecorderList creates a new metric recorder list with all the stats handlers provided which implement the MetricsRecorder interface. If no stats handlers provided implement the MetricsRecorder interface, the MetricsRecorder list returned is a no-op.

func (*MetricsRecorderList) RecordFloat64Count added in v1.66.0

func (l *MetricsRecorderList) RecordFloat64Count(handle *estats.Float64CountHandle, incr float64, labels ...string)

RecordFloat64Count records the measurement alongside labels on the float count associated with the provided handle.

func (*MetricsRecorderList) RecordFloat64Histo added in v1.66.0

func (l *MetricsRecorderList) RecordFloat64Histo(handle *estats.Float64HistoHandle, incr float64, labels ...string)

RecordFloat64Histo records the measurement alongside labels on the float histo associated with the provided handle.

func (*MetricsRecorderList) RecordInt64Count added in v1.66.0

func (l *MetricsRecorderList) RecordInt64Count(handle *estats.Int64CountHandle, incr int64, labels ...string)

RecordInt64Count records the measurement alongside labels on the int count associated with the provided handle.

func (*MetricsRecorderList) RecordInt64Gauge added in v1.66.0

func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, incr int64, labels ...string)

RecordInt64Gauge records the measurement alongside labels on the int gauge associated with the provided handle.

func (*MetricsRecorderList) RecordInt64Histo added in v1.66.0

func (l *MetricsRecorderList) RecordInt64Histo(handle *estats.Int64HistoHandle, incr int64, labels ...string)

RecordInt64Histo records the measurement alongside labels on the int histo associated with the provided handle.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL