(b *testing.B)
| 172 | } |
| 173 | |
| 174 | func BenchmarkSummaryWithLabelValues(b *testing.B) { |
| 175 | m := NewSummaryVec( |
| 176 | SummaryOpts{ |
| 177 | Name: "benchmark_summary", |
| 178 | Help: "A summary to benchmark it.", |
| 179 | Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, |
| 180 | }, |
| 181 | []string{"one", "two", "three"}, |
| 182 | ) |
| 183 | b.ReportAllocs() |
| 184 | b.ResetTimer() |
| 185 | for i := 0; i < b.N; i++ { |
| 186 | m.WithLabelValues("eins", "zwei", "drei").Observe(3.1415) |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | func BenchmarkSummaryNoLabels(b *testing.B) { |
| 191 | m := NewSummary(SummaryOpts{ |
nothing calls this directly
no test coverage detected