metrics

package
v1.9.0-beta7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// APICounterOpts define the counter opts for server APIs
	APICounterOpts = metrics.CounterOpts{
		Namespace:    "api_request",
		Subsystem:    "",
		Name:         "count",
		Help:         "Number of requests made to an API",
		LabelNames:   []string{"ca_name", "api_name", "status_code"},
		StatsdFormat: "%{#fqname}.%{ca_name}.%{api_name}.%{status_code}",
	}

	// APIDurationOpts define the duration opts for server APIs
	APIDurationOpts = metrics.HistogramOpts{
		Namespace:    "api_request",
		Subsystem:    "",
		Name:         "duration",
		Help:         "Time taken in seconds for the request to an API to be completed",
		LabelNames:   []string{"ca_name", "api_name", "status_code"},
		StatsdFormat: "%{#fqname}.%{ca_name}.%{api_name}.%{status_code}",
	}
)

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	// APICounter keeps track of number of times an API endpoint is called
	APICounter metrics.Counter
	// APIDuration keeps track of time taken for request to complete for an API
	APIDuration metrics.Histogram
}

Metrics are the metrics tracked by server

Jump to

Keyboard shortcuts

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