func (n *Namespace) newTimerOpts(name, help string) prometheus.HistogramOpts { return prometheus.HistogramOpts{ Namespace: n.name, Subsystem: n.subsystem, Name: fmt.Sprintf("%s_%s", name, Seconds), Help: help, ConstLabels: prometheus.Labels(n.labels), } }
func (n *Namespace) newCounterOpts(name, help string) prometheus.CounterOpts { return prometheus.CounterOpts{ Namespace: n.name, Subsystem: n.subsystem, Name: fmt.Sprintf("%s_%s", name, Total), Help: help, ConstLabels: prometheus.Labels(n.labels), } }
func (n *Namespace) newGaugeOpts(name, help string, unit Unit) prometheus.GaugeOpts { return prometheus.GaugeOpts{ Namespace: n.name, Subsystem: n.subsystem, Name: fmt.Sprintf("%s_%s", name, unit), Help: help, ConstLabels: prometheus.Labels(n.labels), } }
func (g prometheusGauge) Add(delta float64) { g.GaugeVec.With(prometheus.Labels(g.Pairs)).Add(delta) }
func (g prometheusGauge) Set(value float64) { g.GaugeVec.With(prometheus.Labels(g.Pairs)).Set(value) }
func (c prometheusCounter) Add(delta uint64) { c.CounterVec.With(prometheus.Labels(c.Pairs)).Add(float64(delta)) }
func (h prometheusHistogram) Observe(value int64) { h.HistogramVec.With(prometheus.Labels(h.Pairs)).Observe(float64(value)) }
func (s prometheusSummary) Observe(value int64) { s.SummaryVec.With(prometheus.Labels(s.Pairs)).Observe(float64(value)) }
func (g *gauge) Set(d int64) { g.gv.With(pr.Labels(g.f)).Set(float64(d)) }
func (c *counter) Decr(d uint64) { c.cv.With(pr.Labels(c.f)).Add(-float64(d)) }
func (h *histogram) Reset() { h.hv.With(pr.Labels(h.f)).Observe(0.0) }
func (h *histogram) Record(d int64) { h.hv.With(pr.Labels(h.f)).Observe(float64(d)) }
func (g *gauge) Reset() { g.gv.With(pr.Labels(g.f)).Set(0.0) }