Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithServer ¶ added in v0.2.5
Types ¶
type Config ¶
type Config struct { Addr string `yaml:"addr"` Counter []string `yaml:"counter,omitempty"` CounterVec map[string][]string `yaml:"counter_vec,omitempty"` Gauge []string `yaml:"gauge,omitempty"` GaugeVec map[string][]string `yaml:"gauge_vec,omitempty"` Histogram map[string][]float64 `yaml:"histogram,omitempty"` HistogramVec map[string]Buckets `yaml:"histogram_vec,omitempty"` }
type ConfigMetrics ¶
type ConfigMetrics struct {
Config Config `yaml:"metrics"`
}
func (*ConfigMetrics) Default ¶
func (v *ConfigMetrics) Default()
type CounterInterface ¶
type CounterInterface interface { // Inc increments the counter by 1. Use Add to increment it by arbitrary // non-negative values. Inc() // Add adds the given value to the counter. It panics if the value is < // 0. Add(float64) }
func Counter ¶
func Counter(name string) CounterInterface
Counter is a Metric that represents a single numerical value that only ever goes up. That implies that it cannot be used to count items whose number can also go down, e.g. the number of currently running goroutines. Those "counters" are represented by Gauges.
A Counter is typically used to count requests served, tasks completed, errors occurred, etc.
func CounterVec ¶
func CounterVec(name string, labelNameValue ...string) CounterInterface
CounterVec is a Collector that bundles a set of Counters that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. number of HTTP requests, partitioned by response code and method).
type GaugeInterface ¶
type GaugeInterface interface { // Set sets the Gauge to an arbitrary value. Set(float64) // Inc increments the Gauge by 1. Use Add to increment it by arbitrary // values. Inc() // Dec decrements the Gauge by 1. Use Sub to decrement it by arbitrary // values. Dec() // Add adds the given value to the Gauge. (The value can be negative, // resulting in a decrease of the Gauge.) Add(float64) // Sub subtracts the given value from the Gauge. (The value can be // negative, resulting in an increase of the Gauge.) Sub(float64) // SetToCurrentTime sets the Gauge to the current Unix time in seconds. SetToCurrentTime() }
func Gauge ¶
func Gauge(name string) GaugeInterface
Gauge is a Metric that represents a single numerical value that can arbitrarily go up and down.
A Gauge is typically used for measured values like temperatures or current memory usage, but also "counts" that can go up and down, like the number of running goroutines.
func GaugeVec ¶
func GaugeVec(name string, labelNameValue ...string) GaugeInterface
GaugeVec is a Collector that bundles a set of Gauges that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. number of operations queued, partitioned by user and operation type).
type HistogramInterface ¶
type HistogramInterface interface { // Observe adds a single observation to the histogram. Observations are // usually positive or zero. Observe(float64) }
func Histogram ¶
func Histogram(name string) HistogramInterface
A Histogram counts individual observations from an event or sample stream in configurable static buckets (or in dynamic sparse buckets as part of the experimental Native Histograms, see below for more details). Similar to a Summary, it also provides a sum of observations and an observation count.
func HistogramVec ¶
func HistogramVec(name string, labelNameValue ...string) HistogramInterface
HistogramVec is a Collector that bundles a set of Histograms that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. HTTP request latencies, partitioned by status code and method).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}