Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetricOperations = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "token_operation_seconds", Help: "A histogram of latencies for token operations", Buckets: buckets, }, []string{"token", "op"}, ) MetricResponses = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "token_responses", Help: "Response codes from token operations", }, []string{"token", "op", "code"}, ) )
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
Metrics wraps a token and updates metrics when methods are called
type RateLimited ¶
func NewLimiter ¶
func NewLimiter(base token.Token, limit float64, burst int) *RateLimited
Click to show internal directories.
Click to hide internal directories.