Skip to content

Commit

Permalink
Increase data used in benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Silva Sens <[email protected]>
  • Loading branch information
ArthurSens committed Dec 2, 2024
1 parent 014c812 commit 2dc1870
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions exporter/prometheusremotewriteexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ func BenchmarkPushMetricsVaryingMetrics(b *testing.B) {
}

// benchmarkPushMetrics benchmarks the PushMetrics method with a given number of metrics.
// If numMetrics is -1, it will benchmark with varying number of metrics, from 10 up to 10000.
// If numMetrics is -1, it will benchmark with varying number of metrics, from 100 up to 1000000.
func benchmarkPushMetrics(b *testing.B, numMetrics, numConsumers int) {
mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
Expand Down Expand Up @@ -1327,9 +1327,12 @@ func benchmarkPushMetrics(b *testing.B, numMetrics, numConsumers int) {
for n := 0; n < b.N; n++ {
actualNumMetrics := numMetrics
if numMetrics == -1 {
actualNumMetrics = int(math.Pow(10, float64(n%4+1)))
actualNumMetrics = int(math.Pow(100, float64(n%3+1)))
}
m := testdata.GenerateMetricsManyMetricsSameResource(actualNumMetrics)
for i := 0; i < m.MetricCount(); i++ {
m.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(i).Sum().DataPoints().AppendEmpty().SetIntValue(int64(i))
}
metrics = append(metrics, m)
}

Expand Down

0 comments on commit 2dc1870

Please sign in to comment.