Codebase list golang-github-go-kit-kit / 7bbd216
Make more sence to go. tuanjie 8 years ago
1 changed file(s) with 3 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
44 // NewMultiCounter returns a wrapper around multiple Counters.
55 func NewMultiCounter(counters ...Counter) Counter {
66 c := make(multiCounter, 0, len(counters))
7 for _, counter := range counters {
8 c = append(c, counter)
9 }
10 return c
7 return append(c, counters...)
118 }
129
1310 func (c multiCounter) With(f Field) Counter {
2926 // NewMultiGauge returns a wrapper around multiple Gauges.
3027 func NewMultiGauge(gauges ...Gauge) Gauge {
3128 g := make(multiGauge, 0, len(gauges))
32 for _, gauge := range gauges {
33 g = append(g, gauge)
34 }
35 return g
29 return append(g, gauges...)
3630 }
3731
3832 func (g multiGauge) With(f Field) Gauge {
6054 // NewMultiHistogram returns a wrapper around multiple Histograms.
6155 func NewMultiHistogram(histograms ...Histogram) Histogram {
6256 h := make(multiHistogram, 0, len(histograms))
63 for _, histogram := range histograms {
64 h = append(h, histogram)
65 }
66 return h
57 return append(h, histograms...)
6758 }
6859
6960 func (h multiHistogram) With(f Field) Histogram {