Documentation ¶
Overview ¶
Package reporting provides functionality for reporting metrics to Wavefront.
Index ¶
- func DecodeKey(key string) (string, map[string]string)
- func DeltaCounterName(name string) string
- func EncodeKey(key string, tags map[string]string) string
- func GetMetric(name string, tags map[string]string) interface{}deprecated
- func GetOrRegisterMetric(name string, i interface{}, tags map[string]string) interface{}deprecated
- func NewHistogram(options ...histogram.Option) metrics.Histogram
- func RegisterMetric(name string, metric interface{}, tags map[string]string) errordeprecated
- func UnregisterMetric(name string, tags map[string]string)deprecated
- type Histogram
- func (h Histogram) Clear()
- func (h Histogram) Count() int64
- func (h Histogram) Distributions() []histogram.Distribution
- func (h Histogram) Granularity() histogram.Granularity
- func (h Histogram) Max() int64
- func (h Histogram) Mean() float64
- func (h Histogram) Min() int64
- func (h Histogram) Percentile(p float64) float64
- func (h Histogram) Percentiles(ps []float64) []float64
- func (h Histogram) Sample() metrics.Sample
- func (h Histogram) Snapshot() metrics.Histogram
- func (h Histogram) StdDev() float64
- func (h Histogram) Sum() int64
- func (h Histogram) Update(v int64)
- func (h Histogram) Variance() float64
- type Option
- type RegistryError
- type WavefrontMetricsReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeltaCounterName ¶
DeltaCounterName return a delta counter name prefixed with ∆. Can be used as an input for RegisterMetric() or GetOrRegisterMetric() functions
func GetOrRegisterMetric
deprecated
func NewHistogram ¶
NewHistogram create a new Wavefront Histogram and the wrapper
func RegisterMetric
deprecated
func UnregisterMetric
deprecated
Types ¶
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram wrapper of Wavefront Histogram so it can be used with metrics.Registry
func (Histogram) Distributions ¶
func (h Histogram) Distributions() []histogram.Distribution
Distributions returns all samples on completed time slices, and clear the histogram
func (Histogram) Granularity ¶
func (h Histogram) Granularity() histogram.Granularity
Granularity value
func (Histogram) Percentile ¶
Percentile returns the desired percentile estimation.
func (Histogram) Percentiles ¶
Percentiles returns a slice of arbitrary percentiles of values in the sample
type Option ¶
type Option func(*reporter)
Option allows WavefrontReporter customization
func CustomRegistry ¶
CustomRegistry allows overriding the registry used by the reporter.
func DisableAutoStart ¶
func DisableAutoStart() Option
DisableAutoStart prevents the Reporter from automatically reporting when created.
type RegistryError ¶
type RegistryError string
RegistryError returned if there is any error on RegisterMetric
func (RegistryError) Error ¶
func (err RegistryError) Error() string
type WavefrontMetricsReporter ¶
type WavefrontMetricsReporter interface { // Starts reporting metrics to Wavefront at a given interval. Start() // Stops reporting metrics and closes the reporter. Close() // Reports the metrics to Wavefront just once. Can be used to manually report metrics to Wavefront outside of Start. Report() // Gets the count of errors in reporting metrics to Wavefront. ErrorsCount() int64 // RegisterMetric register the given metric under the given name and tags // return RegistryError if the metric is not registered RegisterMetric(name string, metric interface{}, tags map[string]string) error // GetMetric get the metric by the given name and tags or nil if none is registered. GetMetric(name string, tags map[string]string) interface{} // GetOrRegisterMetric gets an existing metric or registers the given one. // The interface can be the metric to register if not found in registry, // or a function returning the metric for lazy instantiation. GetOrRegisterMetric(name string, i interface{}, tags map[string]string) interface{} // UnregisterMetric Unregister the metric with the given name. UnregisterMetric(name string, tags map[string]string) }
WavefrontMetricsReporter report go-metrics to wavefront
func NewReporter ¶
func NewReporter(sender wf.Sender, application application.Tags, setters ...Option) WavefrontMetricsReporter
NewReporter create a WavefrontMetricsReporter