package pcp
import "github.com/go-kit/kit/metrics/pcp"
Index ¶
- type Counter
- type Gauge
- func (g *Gauge) Add(delta float64)
- func (g *Gauge) Set(value float64)
- func (g *Gauge) With(labelValues ...string) metrics.Gauge
- type Histogram
- func (h *Histogram) Mean() float64
- func (h *Histogram) Observe(value float64)
- func (h *Histogram) Percentile(p float64) int64
- func (h *Histogram) With(labelValues ...string) metrics.Histogram
- type Reporter
- func NewReporter(appname string) (*Reporter, error)
- func (r *Reporter) NewCounter(name string, desc ...string) (*Counter, error)
- func (r *Reporter) NewGauge(name string, desc ...string) (*Gauge, error)
- func (r *Reporter) NewHistogram(name string, min, max int64, unit speed.MetricUnit, desc ...string) (*Histogram, error)
- func (r *Reporter) Start()
- func (r *Reporter) Stop()
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter implements metrics.Counter via a single dimensional speed.Counter.
func (*Counter) Add ¶
Add increments Counter. speed.Counters only take int64, so delta is converted to int64 before observation.
func (*Counter) With ¶
With is a no-op.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge implements metrics.Gauge via a single dimensional speed.Gauge.
func (*Gauge) Add ¶
Add adds a value to the gauge.
func (*Gauge) Set ¶
Set sets the value of the gauge.
func (*Gauge) With ¶
With is a no-op.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram wraps a speed Histogram.
func (*Histogram) Mean ¶
Mean returns the mean of the values observed so far by the Histogram.
func (*Histogram) Observe ¶
Observe observes a value.
This converts float64 value to int64 before observation, as the Histogram in speed is backed using codahale/hdrhistogram, which only observes int64 values. Additionally, the value is interpreted in the metric unit used to construct the histogram.
func (*Histogram) Percentile ¶
Percentile returns a percentile value for the given percentile between 0 and 100 for all values observed by the histogram.
func (*Histogram) With ¶
With is a no-op.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter encapsulates a speed client.
func NewReporter ¶
NewReporter creates a new Reporter instance. The first parameter is the application name and is used to create the speed client. Hence it should be a valid speed parameter name and should not contain spaces or the path separator for your operating system.
func (*Reporter) NewCounter ¶
NewCounter creates a new Counter. This requires a name parameter and can optionally take a couple of description strings, that are used to create the underlying speed.Counter and are reported by PCP.
func (*Reporter) NewGauge ¶
NewGauge creates a new Gauge. This requires a name parameter and can optionally take a couple of description strings, that are used to create the underlying speed.Gauge and are reported by PCP.
func (*Reporter) NewHistogram ¶
func (r *Reporter) NewHistogram(name string, min, max int64, unit speed.MetricUnit, desc ...string) (*Histogram, error)
NewHistogram creates a new Histogram. The minimum observeable value is 0. The maximum observeable value is 3600000000 (3.6e9).
The required parameters are a metric name, the minimum and maximum observable values, and a metric unit for the units of the observed values.
Optionally, it can also take a couple of description strings.
func (*Reporter) Start ¶
func (r *Reporter) Start()
Start starts the underlying speed client so it can start reporting registered metrics to your PCP installation.
func (*Reporter) Stop ¶
func (r *Reporter) Stop()
Stop stops the underlying speed client so it can stop reporting registered metrics to your PCP installation.
Source Files ¶
- Version
- v0.13.0 (latest)
- Published
- May 29, 2023
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 5 hours ago –
Tools for package owners.