| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package exemplar |
| 5 |
|
| 6 |
import "testing" |
| 7 |
|
| 8 |
func TestHist(t *testing.T) { |
| 9 |
bounds := []float64{0, 100} |
| 10 |
t.Run("Int64", ReservoirTest[int64](func(int) (ReservoirProvider, int) { |
| 11 |
return HistogramReservoirProvider(bounds), len(bounds) |
| 12 |
})) |
| 13 |
|
| 14 |
t.Run("Float64", ReservoirTest[float64](func(int) (ReservoirProvider, int) { |
| 15 |
return HistogramReservoirProvider(bounds), len(bounds) |
| 16 |
})) |
| 17 |
} |
| 18 |
|
| 19 |
func TestHistogramReservoirConcurrentSafe(t *testing.T) { |
| 20 |
bounds := []float64{0, 100} |
| 21 |
t.Run("Int64", reservoirConcurrentSafeTest[int64](func(int) (ReservoirProvider, int) { |
| 22 |
return HistogramReservoirProvider(bounds), len(bounds) |
| 23 |
})) |
| 24 |
t.Run("Float64", reservoirConcurrentSafeTest[float64](func(int) (ReservoirProvider, int) { |
| 25 |
return HistogramReservoirProvider(bounds), len(bounds) |
| 26 |
})) |
| 27 |
} |