metrics

package
v0.2.0-prerelease Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package metrics contains a sink interface to be used by clients to implement sink. It also provides a default NoopSink and LogSink for convenience

Index

Constants

View Source
const (
	UNKNOWN byte = iota
	COUNTER
	GAUGE

	SinkTimeout = 1 * time.Second

	ChunkProcessingTimeMetricName    = "chunk_processing_time"
	ChunkLogicalRowsCountMetricName  = "chunk_num_logical_rows"
	ChunkAffectedRowsCountMetricName = "chunk_num_affected_rows"
)

Metric types.

Variables

This section is empty.

Functions

func NewLogSink

func NewLogSink(logger loggers.Advanced) *logSink

Types

type MetricValue

type MetricValue struct {
	// Name is the metric name
	Name string

	// Value is the value of the metric.
	Value float64

	// Type is the metric type: GAUGE, COUNTER, and other const.
	Type byte
}

type Metrics

type Metrics struct {
	Values []MetricValue
}

Metrics are collection of MetricValues.

type NoopSink

type NoopSink struct{}

NoopSink is the default sink which does nothing

func NewNoopSink

func NewNoopSink() *NoopSink

func (*NoopSink) Send

func (s *NoopSink) Send(ctx context.Context, m *Metrics) error

type Sink

type Sink interface {
	// Send sends metrics to the sink. It must respect the context timeout, if any.
	Send(ctx context.Context, metrics *Metrics) error
}

Sink sends metrics to an external destination.

Jump to

Keyboard shortcuts

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