(b *testing.B)
| 3108 | } |
| 3109 | |
| 3110 | func BenchmarkHistogramAggregator_Combine(b *testing.B) { |
| 3111 | // nolint:gosec // G115 |
| 3112 | req := &tempopb.QueryRangeRequest{ |
| 3113 | Start: uint64(time.Now().Add(-1 * time.Hour).UnixNano()), |
| 3114 | End: uint64(time.Now().UnixNano()), |
| 3115 | Step: uint64(15 * time.Second.Nanoseconds()), |
| 3116 | Exemplars: 100, |
| 3117 | } |
| 3118 | const seriesCount = 6 |
| 3119 | |
| 3120 | benchmarks := []struct { |
| 3121 | name string |
| 3122 | samplesCount int |
| 3123 | exemplarCount int |
| 3124 | }{ |
| 3125 | {"Small", 10, 5}, |
| 3126 | {"Medium", 100, 20}, |
| 3127 | {"Large", 1000, 100}, |
| 3128 | } |
| 3129 | |
| 3130 | for _, bm := range benchmarks { |
| 3131 | b.Run(bm.name, func(b *testing.B) { |
| 3132 | series := generateTestTimeSeries(seriesCount, bm.samplesCount, bm.exemplarCount, req.Start, req.End) |
| 3133 | |
| 3134 | for b.Loop() { |
| 3135 | agg := NewHistogramAggregator(req, []float64{0.5, 0.9, 0.99}, uint32(bm.exemplarCount)) // nolint: gosec // G115 |
| 3136 | agg.Combine(series) |
| 3137 | } |
| 3138 | }) |
| 3139 | } |
| 3140 | } |
| 3141 | |
| 3142 | func BenchmarkHistogramAggregator_Results(b *testing.B) { |
| 3143 | // nolint:gosec // G115 |
nothing calls this directly
no test coverage detected