metrics

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIStats

func APIStats(api string, f http.HandlerFunc) http.HandlerFunc

APIStats wraps http handler for api with basic statistics collection.

Types

type HTTPAPIStats

type HTTPAPIStats struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

HTTPAPIStats holds statistics information about the API given in the requests.

func (*HTTPAPIStats) Dec

func (stats *HTTPAPIStats) Dec(api string)

Dec increments the api stats counter.

func (*HTTPAPIStats) Inc

func (stats *HTTPAPIStats) Inc(api string)

Inc increments the api stats counter.

func (*HTTPAPIStats) Load

func (stats *HTTPAPIStats) Load() map[string]int

Load returns the recorded stats.

type HTTPStats

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

HTTPStats holds statistics information about HTTP requests made by all clients.

Jump to

Keyboard shortcuts

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