(b *testing.B)
| 156 | } |
| 157 | |
| 158 | func BenchmarkGoCollector(b *testing.B) { |
| 159 | c := NewGoCollector().(*goCollector) |
| 160 | |
| 161 | b.ResetTimer() |
| 162 | for i := 0; i < b.N; i++ { |
| 163 | ch := make(chan Metric, 8) |
| 164 | go func() { |
| 165 | // Drain all metrics received until the |
| 166 | // channel is closed. |
| 167 | for range ch { |
| 168 | } |
| 169 | }() |
| 170 | c.Collect(ch) |
| 171 | close(ch) |
| 172 | } |
| 173 | } |
nothing calls this directly
no test coverage detected