metrics

package
v0.0.0-...-4dcfcdd Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package metrics contains some common utility functions for constructing performance-monitoring metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LatencyBuckets is a default collection of histogram buckets
	// for latency metrics. The values in this slice assume that the
	// metric's base units are measured in seconds.
	LatencyBuckets = Buckets(time.Millisecond.Seconds(), time.Minute.Seconds())
	// SchemaLabels are the labels to be applied to single-schema vector
	// metrics.
	SchemaLabels = []string{schemaLabel}
	// TableLabels are the labels to be applied to table-specific,
	// vector metrics.
	TableLabels = []string{schemaLabel, tableLabel}
)

Functions

func Buckets

func Buckets(base, max float64) []float64

Buckets computes a linear log10 sequence of buckets, starting from the base unit, up to the specified maximum.

func SchemaValues

func SchemaValues(sch ident.Schema) []string

SchemaValues returns the values to plug into a vector metric that expects SchemaLabels.

func TableValues

func TableValues(table ident.Table) []string

TableValues returns the values to plug into a vector metric that expects TableLabels.

Types

This section is empty.

Jump to

Keyboard shortcuts

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