(b *testing.B)
| 3081 | } |
| 3082 | |
| 3083 | func BenchmarkSumOverTime(b *testing.B) { |
| 3084 | totalSpans := 1_000_000 |
| 3085 | in := make([]Span, 0, totalSpans) |
| 3086 | in2 := make([]Span, 0, totalSpans) |
| 3087 | minimum := 1e10 // 10 billion |
| 3088 | maximun := 1e20 // 100 quintillion |
| 3089 | |
| 3090 | for range totalSpans { |
| 3091 | s := time.Duration(randInt(1, 3)) * time.Second |
| 3092 | v := randFloat(minimum, maximun) |
| 3093 | in = append(in, newMockSpan(nil).WithStartTime(uint64(s)).WithSpanString("foo", "bar").WithSpanFloat("kafka.lag", v).WithDuration(100)) |
| 3094 | s = time.Duration(randInt(1, 3)) * time.Second |
| 3095 | v = randFloat(minimum, maximun) |
| 3096 | in2 = append(in2, newMockSpan(nil).WithStartTime(uint64(s)).WithSpanString("foo", "bar").WithSpanFloat("kafka.lag", v).WithDuration(100)) |
| 3097 | } |
| 3098 | |
| 3099 | req := &tempopb.QueryRangeRequest{ |
| 3100 | Start: uint64(1 * time.Second), |
| 3101 | End: uint64(3 * time.Second), |
| 3102 | Step: uint64(1 * time.Second), |
| 3103 | Query: "{ } | sum_over_time(span.kafka.lag) by (span.foo)", |
| 3104 | } |
| 3105 | for b.Loop() { |
| 3106 | _, _, _ = runTraceQLMetric(req, in, in2) |
| 3107 | } |
| 3108 | } |
| 3109 | |
| 3110 | func BenchmarkHistogramAggregator_Combine(b *testing.B) { |
| 3111 | // nolint:gosec // G115 |
nothing calls this directly
no test coverage detected