Change:
}) } } <ins> func TestHistogramVec_GetAggregatedSampleCount(t *testing.T) { tests := []struct { name string vec  HistogramVec want uint64 }{ { name: "nil case", want: 0, }, { name: "zero case", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}}, }, want: 0, }, { name: "standard case", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(4), SampleSum: pointer.Float64Ptr(8.0)}}, }, want: 7, }, { name: "mixed case", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}}, }, want: 3, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := tt.vec.GetAggregatedSampleCount(); got != tt.want { t.Errorf("GetAggregatedSampleCount() = %v, want %v", got, tt.want) } }) } } func TestHistogramVec_GetAggregatedSampleSum(t *testing.T) { tests := []struct { name string vec  HistogramVec want float64 }{ { name: "nil case", want: 0.0, }, { name: "zero case", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}}, }, want: 0.0, }, { name: "standard case", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(4), SampleSum: pointer.Float64Ptr(8.0)}}, }, want: 14.0, }, { name: "mixed case", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(2.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(0), SampleSum: pointer.Float64Ptr(0.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(4.0)}}, }, want: 6.0, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := tt.vec.GetAggregatedSampleSum(); got != tt.want { t.Errorf("GetAggregatedSampleSum() = %v, want %v", got, tt.want) } }) } } func TestHistogramVec_Quantile(t *testing.T) { tests := []struct { name     string samples  [][]float64 bounds   []float64 quantile float64 want     []float64 }{ { name: "duplicated histograms", samples: [][]float64{ {0.5, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 3, 3, 3, 3, 6, 6, 6, 6}, {0.5, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 3, 3, 3, 3, 6, 6, 6, 6}, {0.5, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 3, 3, 3, 3, 6, 6, 6, 6}, }, bounds: []float64{1, 2, 4, 8}, want:   []float64{2, 6.4, 7.2, 7.84}, }, { name: "random numbers", samples: [][]float64{ {8, 35, 47, 61, 56, 69, 66, 74, 35, 69, 5, 38, 58, 40, 36, 12}, {79, 44, 57, 46, 11, 8, 53, 77, 13, 35, 38, 47, 73, 16, 26, 29}, {51, 76, 22, 55, 20, 63, 59, 66, 34, 58, 64, 16, 79, 7, 58, 28}, }, bounds: []float64{10, 20, 40, 80}, want:   []float64{44.44, 72.89, 76.44, 79.29}, }, { name: "single histogram", samples: [][]float64{ {6, 34, 30, 10, 20, 18, 26, 31, 4, 2, 33, 17, 30, 1, 18, 29}, }, bounds: []float64{10, 20, 40, 80}, want:   []float64{20, 36, 38, 39.6}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var vec HistogramVec for _, sample := range tt.samples { histogram := samples2Histogram(sample, tt.bounds) vec = append(vec, &histogram) } var got []float64 for _, q := range []float64{0.5, 0.9, 0.95, 0.99} { got = append(got, math.Round(vec.Quantile(q)*100)/100) } if !reflect.DeepEqual(got, tt.want) { t.Errorf("Quantile() = %v, want %v", got, tt.want) } }) } } func TestHistogramVec_Validate(t *testing.T) { tests := []struct { name string vec  HistogramVec want error }{ { name: "nil SampleCount", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(1.0)}}, &Histogram{&dto.Histogram{SampleSum: pointer.Float64Ptr(2.0)}}, }, want: fmt.Errorf("nil or empty histogram SampleCount"), }, { name: "valid HistogramVec", vec: HistogramVec{ &Histogram{&dto.Histogram{SampleCount: uint64Ptr(1), SampleSum: pointer.Float64Ptr(1.0)}}, &Histogram{&dto.Histogram{SampleCount: uint64Ptr(2), SampleSum: pointer.Float64Ptr(2.0)}}, }, }, { name: "different bucket size", vec: HistogramVec{ &Histogram{&dto.Histogram{ SampleCount: uint64Ptr(4), SampleSum:   pointer.Float64Ptr(10.0), Bucket: []*dto.Bucket{ {CumulativeCount: uint64Ptr(1), UpperBound: pointer.Float64Ptr(1)}, {CumulativeCount: uint64Ptr(2), UpperBound: pointer.Float64Ptr(2)}, {CumulativeCount: uint64Ptr(5), UpperBound: pointer.Float64Ptr(4)}, }, }}, &Histogram{&dto.Histogram{ SampleCount: uint64Ptr(3), SampleSum:   pointer.Float64Ptr(8.0), Bucket: []*dto.Bucket{ {CumulativeCount: uint64Ptr(1), UpperBound: pointer.Float64Ptr(2)}, {CumulativeCount: uint64Ptr(3), UpperBound: pointer.Float64Ptr(4)}, }, }}, }, want: fmt.Errorf("found different bucket size: expect 3, but got 2 at index 1"), }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := tt.vec.Validate(); fmt.Sprintf("%v", got) != fmt.Sprintf("%v", tt.want) { t.Errorf("Validate() = %v, want %v", got, tt.want) } }) } } </ins>

Discussion:
The new scheduler performance test was introduced back in 1.18, back then, the metric it supported are all . However, along with , some metrics are updated to be , and hence it's no longer appropriate to return the first Histogram: However, it's very common (for instance Preemption) that the metrics may hold multiple histograms: Additionally, metrics and have been removed, we should update them to : /sig scheduling
/triage accepted /assign
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-contributor-experience at . /lifecycle stale
/remove-lifecycle stale