Documentation
¶
Index ¶
Constants ¶
View Source
const Dummy = dummy(0)
Dummy is a dummy recorder.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPProperties ¶
type HTTPProperties struct { // Service is the service that has served the request. Service string // ID is the id of the request handler. ID string }
HTTPProperties are the metric properties for the global server metrics.
type HTTPReqProperties ¶
type HTTPReqProperties struct { // Service is the service that has served the request. Service string // ID is the id of the request handler. ID string // Method is the method of the request. Method string // Code is the response of the request. Code string }
HTTPReqProperties are the metric properties for the metrics based on client request.
type Recorder ¶
type Recorder interface { // ObserveHTTPRequestDuration measures the duration of an HTTP request. ObserveHTTPRequestDuration(ctx context.Context, props HTTPReqProperties, duration time.Duration) // ObserveHTTPResponseSize measures the size of an HTTP response in bytes. ObserveHTTPResponseSize(ctx context.Context, props HTTPReqProperties, sizeBytes int64) // AddInflightRequests increments and decrements the number of inflight request being // processed. AddInflightRequests(ctx context.Context, props HTTPProperties, quantity int) }
Recorder knows how to record and measure the metrics. This Interface has the required methods to be used with the HTTP middlewares.
Directories
¶
Path | Synopsis |
---|---|
Package gin is a helper package to get a gin compatible middleware.
|
Package gin is a helper package to get a gin compatible middleware. |
Package middleware will measure metrics of different http handler types using a `metrics.Recorder`.
|
Package middleware will measure metrics of different http handler types using a `metrics.Recorder`. |
Click to show internal directories.
Click to hide internal directories.