Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CounterFactory ¶ added in v1.0.0
type CounterFactory interface {
Create(metric string, labelKeys []string) CounterVec
}
CounterFactory interface for making new CounterVec instances
type CounterVec ¶ added in v1.0.0
type CounterVec interface { GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error) GetMetricWith(labels prometheus.Labels) (prometheus.Counter, error) WithLabelValues(lvs ...string) prometheus.Counter With(labels prometheus.Labels) prometheus.Counter }
CounterVec interface for counter vectors in prometheus backend
type Factory ¶ added in v1.0.0
type Factory interface {
Create() Incrementer
}
Factory interface for making new incrementer instances
type Incrementer ¶
type Incrementer interface { // Increment increments metric Increment(metric string, labels ...map[string]string) // IncrementN increments metric by n IncrementN(metric string, n int, labels ...map[string]string) // Increment increments all metrics for given bucket IncrementAll(b bucket.Bucket) // Increment increments all metrics for given bucket by n IncrementAllN(b bucket.Bucket, n int) }
Incrementer is a metric incrementer interface
type Log ¶
type Log struct{}
Log struct is Incrementer interface implementation that writes all metrics to log
func (*Log) IncrementAll ¶
IncrementAll writes all metrics for given bucket to log
func (*Log) IncrementAllN ¶
IncrementAllN writes all metrics for given bucket to log
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory struct is Incrementer interface implementation that stores results in memory for further usage
func (*Memory) IncrementAll ¶
IncrementAll increments all metrics for given bucket in memory
func (*Memory) IncrementAllN ¶
IncrementAllN increments all metrics for given bucket in memory
func (*Memory) IncrementN ¶
IncrementN increments given metric in memory
type Prometheus ¶ added in v1.0.0
Prometheus struct is Incrementer interface implementation that writes all metrics to Prometheus
func NewPrometheus ¶ added in v1.0.0
func NewPrometheus(counterFactory CounterFactory) *Prometheus
NewPrometheus creates new prometheus incrementer instance
func (*Prometheus) Increment ¶ added in v1.0.0
func (i *Prometheus) Increment(metric string, labels ...map[string]string)
Increment increments metric in prometheus
func (*Prometheus) IncrementAll ¶ added in v1.0.0
func (i *Prometheus) IncrementAll(b bucket.Bucket)
IncrementAll increments all metrics for given bucket in prometheus
func (*Prometheus) IncrementAllN ¶ added in v1.0.0
func (i *Prometheus) IncrementAllN(b bucket.Bucket, n int)
IncrementAllN increments all metrics for given bucket in prometheus
func (*Prometheus) IncrementN ¶ added in v1.0.0
func (i *Prometheus) IncrementN(metric string, n int, labels ...map[string]string)
IncrementN increments metric by n in prometheus
type PrometheusCounterFactory ¶ added in v1.0.0
type PrometheusCounterFactory struct{}
PrometheusCounterFactory implements CounterFactory interface
func NewPrometheusCounterFactory ¶ added in v1.0.0
func NewPrometheusCounterFactory() *PrometheusCounterFactory
NewPrometheusCounterFactory returns new PrometheusCounterFactory instance
func (*PrometheusCounterFactory) Create ¶ added in v1.0.0
func (f *PrometheusCounterFactory) Create(metric string, labelKeys []string) CounterVec
Create method returns new CounterVec instance with metric and labelKeys attributes
type PrometheusIncrementerFactory ¶ added in v1.0.0
type PrometheusIncrementerFactory struct{}
PrometheusIncrementerFactory implements Factory interface
func NewPrometheusIncrementerFactory ¶ added in v1.0.0
func NewPrometheusIncrementerFactory() *PrometheusIncrementerFactory
NewPrometheusIncrementerFactory returns new NewPrometheusIncrementerFactory instance
func (*PrometheusIncrementerFactory) Create ¶ added in v1.0.0
func (p *PrometheusIncrementerFactory) Create() Incrementer
Create method returns new Prometheus incrementer instance
type StatsD ¶ added in v0.6.0
type StatsD struct {
// contains filtered or unexported fields
}
StatsD struct is Incrementer interface implementation that writes all metrics to statsd
func NewStatsD ¶ added in v0.6.0
func NewStatsD(c *statsd.Client) *StatsD
NewStatsD creates new statsd incrementer instance
func (*StatsD) IncrementAll ¶ added in v0.6.0
IncrementAll increments all metrics for given bucket in statsd
func (*StatsD) IncrementAllN ¶ added in v0.6.0
IncrementAllN increments all metrics for given bucket in statsd