redmetrics

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 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 Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a metrics client that wraps some common RED metrics for all services/servers/stores to consume.

func NewClient

func NewClient(resource string) Client

NewClient is a client constructor.

func (Client) Count

func (l Client) Count(op string, count int64)

Count increments the operation count by the specified count. Example would be an op of "insert_item_rows" with a count of 100. Useful in a bulk insert metric.

func (Client) DecrCount

func (l Client) DecrCount(op string, count int64)

DecrCount decrements the operation count by the specified count.

func (Client) IncErrs

func (l Client) IncErrs(op string)

IncErrs increments the number of errors by 1 for the given operation.

func (Client) IncReqs

func (l Client) IncReqs(op string)

IncReqs increments the number of requests by 1 for the given operation.

func (Client) NewTimer

func (l Client) NewTimer(op string) metrics.StopFunc

NewTimer creates a new timer metric.

func (Client) REDCountMetrics

func (l Client) REDCountMetrics(op string) func(int, error) error

REDCountMetrics is a method for capturing all RED metrics for a given method in addition to the count metric. Often used alongside a List call or the like.

func (Client) REDMetrics

func (l Client) REDMetrics(op string) func(error) error

REDMetrics is a method for capturing all RED metrics for a given method. The RED metrics being request, errors, and duration

Jump to

Keyboard shortcuts

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