Documentation ¶
Index ¶
- Variables
- type EventType
- type Prometheus
- func (p *Prometheus) IncResourceEventProcessed(controller string, eventType EventType)
- func (p *Prometheus) IncResourceEventProcessedError(controller string, eventType EventType)
- func (p *Prometheus) IncResourceEventQueued(controller string, eventType EventType)
- func (p *Prometheus) ObserveDurationResourceEventProcessed(controller string, eventType EventType, start time.Time)
- type Recorder
Constants ¶
This section is empty.
Variables ¶
var Dummy = &dummy{}
Dummy is a dummy stats recorder.
Functions ¶
This section is empty.
Types ¶
type EventType ¶ added in v0.4.0
type EventType string
EventType is the event type handled by the controller.
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
Prometheus implements the metrics recording in a prometheus registry.
func NewPrometheus ¶
func NewPrometheus(registry prometheus.Registerer) *Prometheus
NewPrometheus returns a new Prometheus metrics backend with metrics prefixed by the namespace.
func NewPrometheusWithBuckets ¶
func NewPrometheusWithBuckets(buckets []float64, registry prometheus.Registerer) *Prometheus
NewPrometheusWithBuckets returns a new Prometheus metrics backend with metrics prefixed by the namespace and with custom buckets for the duration/latency metrics. This kind should be used when the default buckets don't work. This could happen when the time to process an event is not on the range of 5ms-10s duration. Check https://godoc.org/github.com/prometheus/client_golang/prometheus#pkg-variables
func (*Prometheus) IncResourceEventProcessed ¶ added in v0.4.0
func (p *Prometheus) IncResourceEventProcessed(controller string, eventType EventType)
IncResourceEventProcessed satisfies metrics.Recorder interface.
func (*Prometheus) IncResourceEventProcessedError ¶ added in v0.4.0
func (p *Prometheus) IncResourceEventProcessedError(controller string, eventType EventType)
IncResourceEventProcessedError satisfies metrics.Recorder interface.
func (*Prometheus) IncResourceEventQueued ¶ added in v0.4.0
func (p *Prometheus) IncResourceEventQueued(controller string, eventType EventType)
IncResourceEventQueued satisfies metrics.Recorder interface.
func (*Prometheus) ObserveDurationResourceEventProcessed ¶ added in v0.4.0
func (p *Prometheus) ObserveDurationResourceEventProcessed(controller string, eventType EventType, start time.Time)
ObserveDurationResourceEventProcessed satisfies metrics.Recorder interface.
type Recorder ¶
type Recorder interface { // IncResourceEvent increments in one the metric records of a queued event. IncResourceEventQueued(controller string, eventType EventType) // IncResourceEventProcessed increments in one the metric records processed event. IncResourceEventProcessed(controller string, eventType EventType) // IncResourceEventProcessedError increments in one the metric records of a processed event in error. IncResourceEventProcessedError(controller string, eventType EventType) // ObserveDurationResourceEventProcessed measures the duration it took to process a event. ObserveDurationResourceEventProcessed(controller string, eventType EventType, start time.Time) }
Recorder knows how to record metrics all over the application.