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