Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License. Package metrics provides a metrics collector that stores metrics in Prometheus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPromMetrics ¶
func NewPromMetrics(reg prometheus.Registerer, name, prefix string) *promMetrics
NewPromMetrics creates a new instance of promMetrics.
Types ¶
type Metrics ¶
type Metrics interface {
// RecordRequest records the time it takes to process a request.
RecordRequest(method, handler string, duration float64)
// RecordPeerDiscovery records the time it takes to discover a peer.
RecordPeerDiscovery(ip string, duration float64)
// RecordPeerResponse records the time it takes for a peer to respond for a key.
RecordPeerResponse(ip, key, op string, duration float64, count int64)
// RecordUpstreamResponse records the time it takes for an upstream to respond for a key.
RecordUpstreamResponse(hostname, key, op string, duration float64, count int64)
}
Metrics defines an interface to collect p2p metrics.
func FromContext ¶
FromContext returns the metrics recorder from the context.
Click to show internal directories.
Click to hide internal directories.