metrics

package
Version: v0.0.0-...-b472bfd Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 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.

Source Files

Jump to

Keyboard shortcuts

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