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.
Click to show internal directories.
Click to hide internal directories.