Documentation ¶
Index ¶
- func OptSetNowFn(fn func() time.Time) func(*Tracker)
- type Observed
- type ObservedInput
- type ObservedOutput
- type ObservedProcessor
- type Tracker
- func (t *Tracker) Close() error
- func (t *Tracker) Flush() *Observed
- func (t *Tracker) GetCounter(name string) metrics.StatCounter
- func (t *Tracker) GetCounterVec(name string, labelNames ...string) metrics.StatCounterVec
- func (t *Tracker) GetGauge(name string) metrics.StatGauge
- func (t *Tracker) GetGaugeVec(name string, labelNames ...string) metrics.StatGaugeVec
- func (t *Tracker) GetTimer(name string) metrics.StatTimer
- func (t *Tracker) GetTimerVec(name string, labelNames ...string) metrics.StatTimerVec
- func (t *Tracker) HandlerFunc() http.HandlerFunc
- func (t *Tracker) LastFlushed() time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptSetNowFn ¶
OptSetNowFn sets the function used to obtain a new time value representing now. By default time.Now is used.
Types ¶
type Observed ¶
type Observed struct { Input map[string]ObservedInput `json:"input"` Processor map[string]ObservedProcessor `json:"processor"` Output map[string]ObservedOutput `json:"output"` }
Observed is a subset of typical Benthos metrics collected by streams that we're interested in for studios purposes.
type ObservedInput ¶
type ObservedInput struct {
Received int64 `json:"received"`
}
ObservedInput is a subset of input metrics that we're interested in.
type ObservedOutput ¶
ObservedOutput is a subset of output metrics that we're interested in.
type ObservedProcessor ¶
type ObservedProcessor struct { Received int64 `json:"received"` Sent int64 `json:"sent"` Error int64 `json:"error"` }
ObservedProcessor is a subset of processor metrics that we're interested in.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker keeps a reference to observed metrics and is capable of flushing the currently observed counters. This also implements the internal metrics type as it's used as a drop-in replacement in order to gather those observed counters.
func NewTracker ¶
NewTracker returns a metrics implementation that records studio specific metrics information.
func (*Tracker) Flush ¶
Flush the latest observed metrics and reset all counters for the next epoch.
func (*Tracker) GetCounter ¶
func (t *Tracker) GetCounter(name string) metrics.StatCounter
GetCounter returns an editable counter stat for a given path.
func (*Tracker) GetCounterVec ¶
func (t *Tracker) GetCounterVec(name string, labelNames ...string) metrics.StatCounterVec
GetCounterVec returns an editable counter stat for a given path with labels, these labels must be consistent with any other metrics registered on the same path.
func (*Tracker) GetGaugeVec ¶
func (t *Tracker) GetGaugeVec(name string, labelNames ...string) metrics.StatGaugeVec
GetGaugeVec returns an editable gauge stat for a given path with labels, these labels must be consistent with any other metrics registered on the same path.
func (*Tracker) GetTimerVec ¶
func (t *Tracker) GetTimerVec(name string, labelNames ...string) metrics.StatTimerVec
GetTimerVec returns an editable timer stat for a given path with labels, these labels must be consistent with any other metrics registered on the same path.
func (*Tracker) HandlerFunc ¶
func (t *Tracker) HandlerFunc() http.HandlerFunc
HandlerFunc returns an optional HTTP request handler that exposes metrics from the implementation. If nil is returned then no endpoint will be registered.
func (*Tracker) LastFlushed ¶
LastFlushed returns the time at which the metrics were last flushed.