コード例 #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
ファイル: prometheus.go プロジェクト: cnicolov/kit
func (g prometheusGauge) Add(delta float64) {
	g.GaugeVec.With(prometheus.Labels(g.Pairs)).Add(delta)
}
コード例 #5
0
ファイル: prometheus.go プロジェクト: cnicolov/kit
func (g prometheusGauge) Set(value float64) {
	g.GaugeVec.With(prometheus.Labels(g.Pairs)).Set(value)
}
コード例 #6
0
ファイル: prometheus.go プロジェクト: cnicolov/kit
func (c prometheusCounter) Add(delta uint64) {
	c.CounterVec.With(prometheus.Labels(c.Pairs)).Add(float64(delta))
}
コード例 #7
0
ファイル: prometheus.go プロジェクト: cnicolov/kit
func (h prometheusHistogram) Observe(value int64) {
	h.HistogramVec.With(prometheus.Labels(h.Pairs)).Observe(float64(value))
}
コード例 #8
0
ファイル: prometheus.go プロジェクト: cnicolov/kit
func (s prometheusSummary) Observe(value int64) {
	s.SummaryVec.With(prometheus.Labels(s.Pairs)).Observe(float64(value))
}
コード例 #9
0
ファイル: prometheus.go プロジェクト: micro/go-plugins
func (g *gauge) Set(d int64) {
	g.gv.With(pr.Labels(g.f)).Set(float64(d))
}
コード例 #10
0
ファイル: prometheus.go プロジェクト: micro/go-plugins
func (c *counter) Decr(d uint64) {
	c.cv.With(pr.Labels(c.f)).Add(-float64(d))
}
コード例 #11
0
ファイル: prometheus.go プロジェクト: micro/go-plugins
func (h *histogram) Reset() {
	h.hv.With(pr.Labels(h.f)).Observe(0.0)
}
コード例 #12
0
ファイル: prometheus.go プロジェクト: micro/go-plugins
func (h *histogram) Record(d int64) {
	h.hv.With(pr.Labels(h.f)).Observe(float64(d))
}
コード例 #13
0
ファイル: prometheus.go プロジェクト: micro/go-plugins
func (g *gauge) Reset() {
	g.gv.With(pr.Labels(g.f)).Set(0.0)
}