Documentation ¶
Index ¶
- Variables
- type Capture
- type CaptureHandler
- func (c *CaptureHandler) Counter(name string) metrics.CounterIface
- func (c *CaptureHandler) Gauge(name string) metrics.GaugeIface
- func (c *CaptureHandler) Histogram(name string, unit metrics.MetricUnit) metrics.HistogramIface
- func (c *CaptureHandler) StartCapture() *Capture
- func (*CaptureHandler) Stop(log.Logger)
- func (c *CaptureHandler) StopCapture(capture *Capture)
- func (c *CaptureHandler) Timer(name string) metrics.TimerIface
- func (c *CaptureHandler) WithTags(tags ...metrics.Tag) metrics.Handler
- type CapturedRecording
- type Handler
- type HistogramBucket
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
var ( ErrMetricNotFound = errors.New("metric not found") ErrMetricTypeMismatch = errors.New("metric is not the expected type") ErrMetricLabelMismatch = errors.New("metric labels do not match expected labels") )
Potential errors that the test handler can return trying to find a metric to return.
Functions ¶
This section is empty.
Types ¶
type Capture ¶ added in v1.22.0
type Capture struct {
// contains filtered or unexported fields
}
Capture is a specific capture instance.
func (*Capture) Snapshot ¶ added in v1.22.0
func (c *Capture) Snapshot() map[string][]*CapturedRecording
Snapshot returns a copy of all metrics recorded, keyed by name.
type CaptureHandler ¶ added in v1.22.0
type CaptureHandler struct {
// contains filtered or unexported fields
}
CaptureHandler is a metrics.Handler that captures each metric recording.
func NewCaptureHandler ¶ added in v1.22.0
func NewCaptureHandler() *CaptureHandler
NewCaptureHandler creates a new metrics.Handler that captures.
func (*CaptureHandler) Counter ¶ added in v1.22.0
func (c *CaptureHandler) Counter(name string) metrics.CounterIface
Counter implements metrics.Handler.Counter.
func (*CaptureHandler) Gauge ¶ added in v1.22.0
func (c *CaptureHandler) Gauge(name string) metrics.GaugeIface
Gauge implements metrics.Handler.Gauge.
func (*CaptureHandler) Histogram ¶ added in v1.22.0
func (c *CaptureHandler) Histogram(name string, unit metrics.MetricUnit) metrics.HistogramIface
Histogram implements metrics.Handler.Histogram.
func (*CaptureHandler) StartCapture ¶ added in v1.22.0
func (c *CaptureHandler) StartCapture() *Capture
StartCapture returns a started capture. StopCapture should be called on complete.
func (*CaptureHandler) Stop ¶ added in v1.22.0
func (*CaptureHandler) Stop(log.Logger)
Stop implements metrics.Handler.Stop.
func (*CaptureHandler) StopCapture ¶ added in v1.22.0
func (c *CaptureHandler) StopCapture(capture *Capture)
StopCapture stops capturing metrics for the given capture instance.
func (*CaptureHandler) Timer ¶ added in v1.22.0
func (c *CaptureHandler) Timer(name string) metrics.TimerIface
Timer implements metrics.Handler.Timer.
func (*CaptureHandler) WithTags ¶ added in v1.22.0
func (c *CaptureHandler) WithTags(tags ...metrics.Tag) metrics.Handler
WithTags implements metrics.Handler.WithTags.
type CapturedRecording ¶ added in v1.22.0
type CapturedRecording struct { Value any Tags map[string]string Unit metrics.MetricUnit }
CapturedRecording is a single recording. Fields here should not be mutated.
type Handler ¶
func NewHandler ¶
type HistogramBucket ¶ added in v1.21.0
type HistogramBucket struct {
// contains filtered or unexported fields
}