metrics

package
v0.0.0-...-01d1cd0 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics cosntructs the metrics the application will track.

Index

Constants

View Source
const Key ctxKey = 1

Key is how metric values are stored/retrieved.

Variables

This section is empty.

Functions

func AddPanics

func AddPanics(ctx context.Context)

AddPanics increments the panics metric by 1.

Types

type Metrics

type Metrics struct {
	Goroutines *expvar.Int
	Requests   *expvar.Int
	Errors     *expvar.Int
	Panics     *expvar.Int
}

Metrics represents the set of metrics we gather. These fields are safe to be accessed concurrently. No extra abstraction is required.

func New

func New() *Metrics

New constructs the metrics that will be tracked.

Jump to

Keyboard shortcuts

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