metrics

package
v0.0.0-...-d50bbac Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deployment

func Deployment(
	operation string,
	operationType string,
) map[string]any

Deployment gets common logging attributes for a deployment.

func Error

func Error(
	errorCode string,
) map[string]any

Types

type Metrics

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

Metrics is a metrics tracker for an api operation.

func New

func New() (*Metrics, error)

func (*Metrics) ApiOperationErrors

func (m *Metrics) ApiOperationErrors(
	operation string,
	operationType string,
	errorCode string,
)

ApiOperationErrors increments the count of errors for API operation.

func (*Metrics) ApiOperationLatency

func (m *Metrics) ApiOperationLatency(
	startTime time.Time,
	operation string,
	operationType string,
)

ApiOperationLatency tracks the overall API operation latency.

func (*Metrics) Close

func (m *Metrics) Close()

Close closes all metrics.

Jump to

Keyboard shortcuts

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