metrics

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpApiMetrics

type HttpApiMetrics interface {
	// CollectTotalRequests increment the total requests for the api
	CollectTotalRequests()
	// Collect400TotalRequests increment the total requests for the api with 400 status code
	Collect400TotalRequests()
	// Collect500TotalRequests increment the total requests for the api with 500 status code
	Collect500TotalRequests()
	// CollectRequest increment the total requests for the api with the given method and path and status code
	CollectRequest(method, path string, statusCode int)
	// CollectRequestContentLength increment the total content length for the api with the given method and path
	CollectRequestContentLength(method, path string, contentLength float64)
	// CollectRequestResponseSize increment the total response size for the api with the given method and path
	CollectRequestResponseSize(method, path string, contentLength float64)
	// CollectRequestDuration observe the histogram of the duration of the requests for the api with the given method and path
	CollectRequestDuration(method, path string, duration float64)
}

HttpApiMetrics is an interface that defines the methods that can be used to collect metrics.

func NewHttpApiMetrics

func NewHttpApiMetrics() HttpApiMetrics

NewHttpApiMetrics returns a new instance of httpApiMetrics.

Directories

Path Synopsis
Package mock_metrics is a generated GoMock package.
Package mock_metrics is a generated GoMock package.

Jump to

Keyboard shortcuts

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