Skip to content

Commit 110f6d4

Browse files
authored
Merge pull request #714 from prometheus/beorn7/doc
Explicitly forward metricVec methods Collect, Describe, Reset
2 parents 913f67e + aa6eadd commit 110f6d4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

prometheus/vec.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ func (m *metricVec) Delete(labels Labels) bool {
9191
return m.metricMap.deleteByHashWithLabels(h, labels, m.curry)
9292
}
9393

94+
// Without explicit forwarding of Describe, Collect, Reset, those methods won't
95+
// show up in GoDoc.
96+
97+
// Describe implements Collector.
98+
func (m *metricVec) Describe(ch chan<- *Desc) { m.metricMap.Describe(ch) }
99+
100+
// Collect implements Collector.
101+
func (m *metricVec) Collect(ch chan<- Metric) { m.metricMap.Collect(ch) }
102+
103+
// Reset deletes all metrics in this vector.
104+
func (m *metricVec) Reset() { m.metricMap.Reset() }
105+
94106
func (m *metricVec) curryWith(labels Labels) (*metricVec, error) {
95107
var (
96108
newCurry []curriedLabelValue

0 commit comments

Comments
 (0)