metrics

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WriteMetrics

type WriteMetrics struct {
	Attempts   metrics.Counter `metric:"attempts"`
	Inserts    metrics.Counter `metric:"inserts"`
	Errors     metrics.Counter `metric:"errors"`
	LatencyOk  metrics.Timer   `metric:"latency-ok"`
	LatencyErr metrics.Timer   `metric:"latency-err"`
}

WriteMetrics is a collection of metrics for write operations.

func NewWriteMetrics

func NewWriteMetrics(factory metrics.Factory, tableName string) *WriteMetrics

NewWriteMetrics takes a metrics scope and creates a metrics struct

func (*WriteMetrics) Emit

func (t *WriteMetrics) Emit(err error, latency time.Duration)

Emit will record success or failure counts and latency metrics depending on the passed error.

Jump to

Keyboard shortcuts

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