metrics

package
v0.0.0-...-437ec41 Latest Latest
Warning

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

Go to latest
Published: May 16, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table 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"`
}

Table is a collection of metrics about Cassandra write operations.

func NewTable

func NewTable(factory metrics.Factory, tableName string) *Table

NewTable takes a metrics scope and creates a table metrics struct

func (*Table) Emit

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

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

func (*Table) Exec

func (t *Table) Exec(query cassandra.UpdateQuery, logger *zap.Logger) error

Exec executes an update query and reports metrics/logs about it.

Jump to

Keyboard shortcuts

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