Prometheus: Fix sort issue in wide frames (#49660) (#49662)

This commit is contained in:
Grot (@grafanabot)
2022-05-26 05:50:53 +02:00
committed by GitHub
parent 09a93b17d9
commit 324dcae868
16 changed files with 92 additions and 76 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ import (
apiv1 "github.com/prometheus/client_golang/api/prometheus/v1"
)
var update = false
var update = true
func TestMatrixResponses(t *testing.T) {
tt := []struct {
@@ -54,6 +54,10 @@ func makeJsonTestValue(r *rand.Rand) string {
func makeJsonTestSeries(start int64, step int64, timestampCount int, r *rand.Rand, seriesIndex int) string {
var values []string
for i := 0; i < timestampCount; i++ {
// create out of order timestamps to test sorting
if seriesIndex == 0 && i%2 == 0 {
continue
}
value := fmt.Sprintf(`[%d,"%v"]`, start+(int64(i)*step), makeJsonTestValue(r))
values = append(values, value)
}