File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -656,8 +656,7 @@ loop:
656
656
}
657
657
}
658
658
659
- _ , keepHistograms := q .resultSort .(keepHistogramsSorter )
660
- if ! keepHistograms {
659
+ if ! q .resultSort .keepHistograms () {
661
660
vector = filterFloats (vector )
662
661
}
663
662
sort .Slice (vector , q .resultSort .comparer (& vector ))
Original file line number Diff line number Diff line change @@ -19,24 +19,29 @@ const (
19
19
sortOrderDesc sortOrder = true
20
20
)
21
21
22
- type keepHistogramsSorter interface {
23
- keepHistograms ()
24
- }
25
-
26
22
type resultSorter interface {
27
23
comparer (samples * promql.Vector ) func (i , j int ) bool
24
+ keepHistograms () bool
28
25
}
29
26
30
27
type sortFuncResultSort struct {
31
28
sortOrder sortOrder
32
29
}
33
30
31
+ func (s sortFuncResultSort ) keepHistograms () bool {
32
+ return false
33
+ }
34
+
34
35
type sortByLabelFuncResult struct {
35
36
sortingLabels []string
36
37
37
38
sortOrder sortOrder
38
39
}
39
40
41
+ func (s sortByLabelFuncResult ) keepHistograms () bool {
42
+ return false
43
+ }
44
+
40
45
type aggregateResultSort struct {
41
46
sortingLabels []string
42
47
groupBy bool
@@ -47,9 +52,13 @@ type aggregateResultSort struct {
47
52
type noSortResultSort struct {
48
53
}
49
54
50
- func (a aggregateResultSort ) keepHistograms () {}
55
+ func (a aggregateResultSort ) keepHistograms () bool {
56
+ return true
57
+ }
51
58
52
- func (s noSortResultSort ) keepHistograms () {}
59
+ func (s noSortResultSort ) keepHistograms () bool {
60
+ return true
61
+ }
53
62
54
63
func extractSortingLabels (f * parser.Call ) []string {
55
64
args := f .Args [1 :]
You can’t perform that action at this time.
0 commit comments