Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶ added in v1.0.0
type Factory interface {
Create() State
}
Factory interface for making new state instances
type GaugeFactory ¶ added in v1.0.0
GaugeFactory interface for making new GaugeVec instances
type GaugeVec ¶ added in v1.0.0
type GaugeVec interface { GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error) GetMetricWith(labels prometheus.Labels) (prometheus.Gauge, error) WithLabelValues(lvs ...string) prometheus.Gauge With(labels prometheus.Labels) prometheus.Gauge }
GaugeVec interface for gauge vectors in prometheus backend
type Log ¶
type Log struct{}
Log struct is State interface implementation that writes all states to log
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory struct is State interface implementation that stores results in memory for further usage
type Prometheus ¶ added in v1.0.0
Prometheus struct is State interface implementation that writes all states
func NewPrometheus ¶ added in v1.0.0
func NewPrometheus(gaugeFactory GaugeFactory) *Prometheus
NewPrometheus creates new prometheus state instance
type PrometheusGaugeFactory ¶ added in v1.0.0
type PrometheusGaugeFactory struct{}
PrometheusGaugeFactory implements GaugeFactory interface
func NewPrometheusGaugeFactory ¶ added in v1.0.0
func NewPrometheusGaugeFactory() *PrometheusGaugeFactory
NewPrometheusGaugeFactory returns new PrometheusGaugeFactory instance
type PrometheusStateFactory ¶ added in v1.0.0
type PrometheusStateFactory struct{}
PrometheusStateFactory implements Factory interface
func NewPrometheusStateFactory ¶ added in v1.0.0
func NewPrometheusStateFactory() *PrometheusStateFactory
NewPrometheusStateFactory returns new NewPrometheusIncrementerFactory instance
func (*PrometheusStateFactory) Create ¶ added in v1.0.0
func (p *PrometheusStateFactory) Create() State
Create method returns new Prometheus incrementer instance
type State ¶
type State interface { // Set sets metric state Set(metric string, n int, labels ...map[string]string) }
State is a metric state interface