Example #1
0
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),
	}
}
Example #2
0
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),
	}
}
Example #3
0
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),
	}
}
Example #4
0
func (g prometheusGauge) Add(delta float64) {
	g.GaugeVec.With(prometheus.Labels(g.Pairs)).Add(delta)
}
Example #5
0
func (g prometheusGauge) Set(value float64) {
	g.GaugeVec.With(prometheus.Labels(g.Pairs)).Set(value)
}
Example #6
0
func (c prometheusCounter) Add(delta uint64) {
	c.CounterVec.With(prometheus.Labels(c.Pairs)).Add(float64(delta))
}
Example #7
0
func (h prometheusHistogram) Observe(value int64) {
	h.HistogramVec.With(prometheus.Labels(h.Pairs)).Observe(float64(value))
}
Example #8
0
func (s prometheusSummary) Observe(value int64) {
	s.SummaryVec.With(prometheus.Labels(s.Pairs)).Observe(float64(value))
}
Example #9
0
func (g *gauge) Set(d int64) {
	g.gv.With(pr.Labels(g.f)).Set(float64(d))
}
Example #10
0
func (c *counter) Decr(d uint64) {
	c.cv.With(pr.Labels(c.f)).Add(-float64(d))
}
Example #11
0
func (h *histogram) Reset() {
	h.hv.With(pr.Labels(h.f)).Observe(0.0)
}
Example #12
0
func (h *histogram) Record(d int64) {
	h.hv.With(pr.Labels(h.f)).Observe(float64(d))
}
Example #13
0
func (g *gauge) Reset() {
	g.gv.With(pr.Labels(g.f)).Set(0.0)
}