Documentation ¶
Index ¶
- Constants
- func ConvertLabelsToMap(labels []prompb.Label) map[string]string
- func ConvertNumeric(val interface{}) float64
- func ExtractLabelsFromSpan(span *types.Span, labelToKeyMap map[string][]string) map[string]string
- type Metrics
- type MockMetrics
- func (m *MockMetrics) AddWithLabels(name string, labels map[string]string, value float64)
- func (m *MockMetrics) Count(name string, val interface{})
- func (m *MockMetrics) Gauge(name string, val interface{})
- func (m *MockMetrics) GaugeWithLabels(name string, labels map[string]string, value float64)
- func (m *MockMetrics) Histogram(name string, val interface{})
- func (m *MockMetrics) HistogramWithLabels(name string, labels map[string]string, obs interface{})
- func (m *MockMetrics) Increment(name string)
- func (m *MockMetrics) IncrementWithLabels(name string, labels map[string]string)
- func (m *MockMetrics) Register(name, metricType string)
- func (m *MockMetrics) RegisterCounter(name string, labels []string, desc string)
- func (m *MockMetrics) RegisterGauge(name string, labels []string, desc string)
- func (m *MockMetrics) RegisterHistogram(name string, labels []string, desc string, buckets []float64)
- func (m *MockMetrics) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string)
- func (m *MockMetrics) Start()
- type NullMetrics
- func (n *NullMetrics) AddWithLabels(name string, labels map[string]string, value float64)
- func (n *NullMetrics) Count(name string, val interface{})
- func (n *NullMetrics) Gauge(name string, val interface{})
- func (n *NullMetrics) GaugeWithLabels(name string, labels map[string]string, value float64)
- func (n *NullMetrics) Histogram(name string, obs interface{})
- func (n *NullMetrics) HistogramWithLabels(name string, labels map[string]string, obs interface{})
- func (n *NullMetrics) Increment(name string)
- func (n *NullMetrics) IncrementWithLabels(name string, labels map[string]string)
- func (n *NullMetrics) Register(name, metricType string)
- func (n *NullMetrics) RegisterCounter(name string, labels []string, desc string)
- func (n *NullMetrics) RegisterGauge(name string, labels []string, desc string)
- func (n *NullMetrics) RegisterHistogram(name string, labels []string, desc string, buckets []float64)
- func (n *NullMetrics) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string)
- func (n *NullMetrics) Start()
- type OpsRampAuthTokenResponse
- type OpsRampMetrics
- func (p *OpsRampMetrics) AddWithLabels(name string, labels map[string]string, value float64)
- func (p *OpsRampMetrics) Count(name string, n interface{})
- func (p *OpsRampMetrics) Gauge(name string, val interface{})
- func (p *OpsRampMetrics) GaugeWithLabels(name string, labels map[string]string, value float64)
- func (p *OpsRampMetrics) Histogram(name string, obs interface{})
- func (p *OpsRampMetrics) HistogramWithLabels(name string, labels map[string]string, obs interface{})
- func (p *OpsRampMetrics) Increment(name string)
- func (p *OpsRampMetrics) IncrementWithLabels(name string, labels map[string]string)
- func (p *OpsRampMetrics) Populate()
- func (p *OpsRampMetrics) Push() (int, error)
- func (p *OpsRampMetrics) Register(name, metricType string)
- func (p *OpsRampMetrics) RegisterCounter(name string, labels []string, desc string)
- func (p *OpsRampMetrics) RegisterGauge(name string, labels []string, desc string)
- func (p *OpsRampMetrics) RegisterHistogram(name string, labels []string, desc string, buckets []float64)
- func (p *OpsRampMetrics) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string)
- func (p *OpsRampMetrics) RenewClient()
- func (p *OpsRampMetrics) RenewOAuthToken() error
- func (p *OpsRampMetrics) Send(request *http.Request) (*http.Response, error)
- func (p *OpsRampMetrics) Start() error
Constants ¶
View Source
const ( GAUGE metricType = iota COUNTER HISTOGRAM SUMMARY )
Variables ¶
This section is empty.
Functions ¶
func ConvertNumeric ¶
func ConvertNumeric(val interface{}) float64
Types ¶
type Metrics ¶
type Metrics interface { // Register declares a metric; metricType should be one of counter, gauge, histogram Register(name, metricType string) Increment(name string) Gauge(name string, val interface{}) Count(name string, n interface{}) Histogram(name string, obs interface{}) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string) RegisterGauge(name string, labels []string, desc string) RegisterCounter(name string, labels []string, desc string) RegisterHistogram(name string, labels []string, desc string, buckets []float64) GaugeWithLabels(name string, labels map[string]string, value float64) IncrementWithLabels(name string, labels map[string]string) AddWithLabels(name string, labels map[string]string, value float64) HistogramWithLabels(name string, labels map[string]string, obs interface{}) }
type MockMetrics ¶
type MockMetrics struct { Registrations map[string]string CounterIncrements map[string]int GaugeRecords map[string]float64 Histograms map[string][]float64 // contains filtered or unexported fields }
MockMetrics collects metrics that were registered and changed to allow tests to verify expected behavior
func (*MockMetrics) AddWithLabels ¶
func (m *MockMetrics) AddWithLabels(name string, labels map[string]string, value float64)
func (*MockMetrics) Count ¶
func (m *MockMetrics) Count(name string, val interface{})
func (*MockMetrics) Gauge ¶
func (m *MockMetrics) Gauge(name string, val interface{})
func (*MockMetrics) GaugeWithLabels ¶
func (m *MockMetrics) GaugeWithLabels(name string, labels map[string]string, value float64)
func (*MockMetrics) Histogram ¶
func (m *MockMetrics) Histogram(name string, val interface{})
func (*MockMetrics) HistogramWithLabels ¶
func (m *MockMetrics) HistogramWithLabels(name string, labels map[string]string, obs interface{})
func (*MockMetrics) Increment ¶
func (m *MockMetrics) Increment(name string)
func (*MockMetrics) IncrementWithLabels ¶
func (m *MockMetrics) IncrementWithLabels(name string, labels map[string]string)
func (*MockMetrics) Register ¶
func (m *MockMetrics) Register(name, metricType string)
func (*MockMetrics) RegisterCounter ¶
func (m *MockMetrics) RegisterCounter(name string, labels []string, desc string)
func (*MockMetrics) RegisterGauge ¶
func (m *MockMetrics) RegisterGauge(name string, labels []string, desc string)
func (*MockMetrics) RegisterHistogram ¶
func (m *MockMetrics) RegisterHistogram(name string, labels []string, desc string, buckets []float64)
func (*MockMetrics) RegisterWithDescriptionLabels ¶
func (m *MockMetrics) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string)
func (*MockMetrics) Start ¶
func (m *MockMetrics) Start()
Start initializes all metrics or resets all metrics to zero
type NullMetrics ¶
type NullMetrics struct{}
NullMetrics discards all metrics
func (*NullMetrics) AddWithLabels ¶
func (n *NullMetrics) AddWithLabels(name string, labels map[string]string, value float64)
func (*NullMetrics) Count ¶
func (n *NullMetrics) Count(name string, val interface{})
func (*NullMetrics) Gauge ¶
func (n *NullMetrics) Gauge(name string, val interface{})
func (*NullMetrics) GaugeWithLabels ¶
func (n *NullMetrics) GaugeWithLabels(name string, labels map[string]string, value float64)
func (*NullMetrics) Histogram ¶
func (n *NullMetrics) Histogram(name string, obs interface{})
func (*NullMetrics) HistogramWithLabels ¶
func (n *NullMetrics) HistogramWithLabels(name string, labels map[string]string, obs interface{})
func (*NullMetrics) Increment ¶
func (n *NullMetrics) Increment(name string)
func (*NullMetrics) IncrementWithLabels ¶
func (n *NullMetrics) IncrementWithLabels(name string, labels map[string]string)
func (*NullMetrics) Register ¶
func (n *NullMetrics) Register(name, metricType string)
func (*NullMetrics) RegisterCounter ¶
func (n *NullMetrics) RegisterCounter(name string, labels []string, desc string)
func (*NullMetrics) RegisterGauge ¶
func (n *NullMetrics) RegisterGauge(name string, labels []string, desc string)
func (*NullMetrics) RegisterHistogram ¶
func (n *NullMetrics) RegisterHistogram(name string, labels []string, desc string, buckets []float64)
func (*NullMetrics) RegisterWithDescriptionLabels ¶
func (n *NullMetrics) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string)
func (*NullMetrics) Start ¶
func (n *NullMetrics) Start()
Start initializes all metrics or resets all metrics to zero
type OpsRampMetrics ¶
type OpsRampMetrics struct { Config config.Config `inject:""` Logger logger.Logger `inject:""` Client *http.Client Proxy *proxy.Proxy `inject:"proxyConfig"` // contains filtered or unexported fields }
func (*OpsRampMetrics) AddWithLabels ¶
func (p *OpsRampMetrics) AddWithLabels(name string, labels map[string]string, value float64)
func (*OpsRampMetrics) Count ¶
func (p *OpsRampMetrics) Count(name string, n interface{})
func (*OpsRampMetrics) Gauge ¶
func (p *OpsRampMetrics) Gauge(name string, val interface{})
func (*OpsRampMetrics) GaugeWithLabels ¶
func (p *OpsRampMetrics) GaugeWithLabels(name string, labels map[string]string, value float64)
func (*OpsRampMetrics) Histogram ¶
func (p *OpsRampMetrics) Histogram(name string, obs interface{})
func (*OpsRampMetrics) HistogramWithLabels ¶
func (p *OpsRampMetrics) HistogramWithLabels(name string, labels map[string]string, obs interface{})
func (*OpsRampMetrics) Increment ¶
func (p *OpsRampMetrics) Increment(name string)
func (*OpsRampMetrics) IncrementWithLabels ¶
func (p *OpsRampMetrics) IncrementWithLabels(name string, labels map[string]string)
func (*OpsRampMetrics) Populate ¶
func (p *OpsRampMetrics) Populate()
func (*OpsRampMetrics) Push ¶
func (p *OpsRampMetrics) Push() (int, error)
func (*OpsRampMetrics) Register ¶
func (p *OpsRampMetrics) Register(name, metricType string)
Register takes a name and a metric type. The type should be one of "counter", "gauge", or "histogram"
func (*OpsRampMetrics) RegisterCounter ¶
func (p *OpsRampMetrics) RegisterCounter(name string, labels []string, desc string)
func (*OpsRampMetrics) RegisterGauge ¶
func (p *OpsRampMetrics) RegisterGauge(name string, labels []string, desc string)
func (*OpsRampMetrics) RegisterHistogram ¶
func (p *OpsRampMetrics) RegisterHistogram(name string, labels []string, desc string, buckets []float64)
func (*OpsRampMetrics) RegisterWithDescriptionLabels ¶
func (p *OpsRampMetrics) RegisterWithDescriptionLabels(name, metricType, desc string, labels []string)
RegisterWithDescriptionLabels takes a name, a metric type, description, labels. The type should be one of "counter", "gauge", or "histogram"
func (*OpsRampMetrics) RenewClient ¶
func (p *OpsRampMetrics) RenewClient()
func (*OpsRampMetrics) RenewOAuthToken ¶
func (p *OpsRampMetrics) RenewOAuthToken() error
func (*OpsRampMetrics) Start ¶
func (p *OpsRampMetrics) Start() error
Click to show internal directories.
Click to hide internal directories.