metrics

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 2 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 for convenience.

Index

Constants

View Source
const (
	UNKNOWN byte = iota
	COUNTER
	GAUGE
)

Metric types.

View Source
const (
	SinkTimeout                      = 1 * time.Second
	ChunkProcessingTimeMetricName    = "chunk_processing_time"
	ChunkLogicalRowsCountMetricName  = "chunk_num_logical_rows"
	ChunkAffectedRowsCountMetricName = "chunk_num_affected_rows"
	// WriteThreadsMetricName reports the live write-thread (apply-worker) count
	// chosen by the autoscaler. ThrottlerUtilizationMetricName reports the
	// continuous load signal (0..>1) the autoscaler controls on.
	WriteThreadsMetricName         = "write_threads"
	ThrottlerUtilizationMetricName = "throttler_utilization"
)

Variables

This section is empty.

Functions

This section is empty.

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 (*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