metrics

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

Batch allows the collection of multiple data points, and to send it to the Collector after finalization.

func NewMetricsBatch

func NewMetricsBatch(dataCh chan<- []*pb.MetricsPayload_Metric) *Batch

NewMetricsBatch creates and returns a new MetricsBatch.

func (*Batch) Commit

func (s *Batch) Commit()

Commit finalizes the data, adding a timestamp, and then sends it to Collector. Data gets grouped by timestamp, and then sent to the API.

func (*Batch) Gauge

func (s *Batch) Gauge(key string, value float64, labels []*pb.MetricsPayload_Label)

Gauge accepts a metric key and a value, inserting it into the batch data.

func (*Batch) Info

func (s *Batch) Info(key string, value []*pb.MetricsPayload_Label, labels []*pb.MetricsPayload_Label)

Info accepts a metric key and a value, inserting it into the batch data.

Jump to

Keyboard shortcuts

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