Skip to content

Commit 8a1562c

Browse files
craig[bot]dhartunian
andcommitted
Merge #147707
147707: metric: fix truncated histogram tests for s390x r=alyshanjahani-crl a=dhartunian Previous attempt to get `TestHistogramBuckets` to pass was not correct. This change reverts the test files and removes the truncation. Instead, we have a separate set of datadriven reference files for the s390x architecture. Resolves: #145975 Release note: None Co-authored-by: David Hartunian <[email protected]>
2 parents d9c3a94 + 4837600 commit 8a1562c

20 files changed

+634
-278
lines changed

pkg/util/metric/histogram_buckets_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package metric
77

88
import (
99
"fmt"
10-
"math"
10+
"runtime"
1111
"strings"
1212
"testing"
1313

@@ -26,18 +26,22 @@ func TestHistogramBuckets(t *testing.T) {
2626
if idx == 0 {
2727
fmt.Fprintf(&buf, "%s", category)
2828
}
29-
// Truncate to avoid architecture-specific floating point differences
30-
truncated := math.Trunc(f)
31-
fmt.Fprintf(&buf, "\n%f", truncated)
29+
fmt.Fprintf(&buf, "\n%f", f)
3230
}
3331
return buf.String()
3432
}
3533

34+
arch := runtime.GOARCH
3635
for _, config := range StaticBucketConfigs {
3736
exp := config.GetBucketsFromBucketConfig()
3837
buf := verifyAndPrint(t, exp, config.category)
3938

40-
echotest.Require(t, buf, datapathutils.TestDataPath(t, config.category))
39+
category := config.category
40+
if arch == "s390x" {
41+
category = fmt.Sprintf("%s_%s", category, arch)
42+
}
43+
44+
echotest.Require(t, buf, datapathutils.TestDataPath(t, category))
4145
}
4246

4347
}

pkg/util/metric/testdata/BatchProcessLatencyBuckets

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,62 @@ echo
22
----
33
BatchProcessLatencyBuckets
44
500000000.000000
5-
557259285.000000
6-
621075822.000000
7-
692200537.000000
8-
771470353.000000
9-
859818036.000000
10-
958283168.000000
11-
1068024387.000000
12-
1190333014.000000
13-
1326648249.000000
14-
1478574110.000000
15-
1647898304.000000
16-
1836613263.000000
17-
2046939589.000000
18-
2281352185.000000
19-
2542609376.000000
20-
2833785368.000000
21-
3158306418.000000
22-
3519991155.000000
23-
3923095511.000000
24-
4372362802.000000
25-
4873079541.000000
26-
5431137645.000000
27-
6053103765.000000
28-
6746296557.000000
29-
7518872796.000000
30-
8379923362.000000
31-
9339580208.000000
32-
10409135585.000000
33-
11601174915.000000
34-
12929724885.000000
35-
14410418498.000000
36-
16060679028.000000
37-
17899925035.000000
38-
19949798866.000000
39-
22234421319.000000
40-
24780675469.000000
41-
27618523005.000000
42-
30781356785.000000
43-
34306393769.000000
44-
38235112950.000000
45-
42613743436.000000
46-
47493808428.000000
47-
52932731487.000000
48-
58994512241.000000
49-
65750479463.000000
50-
73280130395.000000
51-
81672066190.000000
52-
91025034477.000000
53-
101449091325.000000
54-
113066896265.000000
55-
126015155620.000000
56-
140446231131.000000
57-
156529932783.000000
58-
174455516959.000000
59-
194433913416.000000
60-
216700207279.000000
61-
241516405291.000000
62-
269174518830.000000
63-
300000000000.000000
5+
557259285.358743
6+
621075822.237074
7+
692200537.706851
8+
771470353.934916
9+
859818036.218456
10+
958283168.803309
11+
1068024387.637287
12+
1190333014.000928
13+
1326648249.442152
14+
1478574110.813123
15+
1647898304.683320
16+
1836613263.223422
17+
2046939589.088547
18+
2281352185.176006
19+
2542609376.725576
20+
2833785368.441068
21+
3158306418.555065
22+
3519991155.495853
23+
3923095511.561431
24+
4372362802.333632
25+
4873079541.115184
26+
5431137645.156319
27+
6053103765.649553
28+
6746296557.296375
29+
7518872796.674253
30+
8379923362.755980
31+
9339580208.980864
32+
10409135585.614676
33+
11601174915.283792
34+
12929724885.225649
35+
14410418498.852003
36+
16060679028.781363
37+
17899925035.909710
38+
19949798866.972237
39+
22234421319.319225
40+
24780675469.538071
41+
27618523005.723442
42+
30781356785.666904
43+
34306393769.506477
44+
38235112950.461639
45+
42613743436.770157
46+
47493808428.070732
47+
52932731487.183495
48+
58994512241.268242
49+
65750479463.313522
50+
73280130395.441635
51+
81672066190.318619
52+
91025034477.977859
53+
101449091325.905777
54+
113066896265.136261
55+
126015155620.881943
56+
140446231131.326965
57+
156529932783.144257
58+
174455516959.974152
59+
194433913416.010529
60+
216700207279.419586
61+
241516405291.241699
62+
269174518830.019897
63+
300000000000.000854
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
echo
2+
----
3+
BatchProcessLatencyBuckets
4+
500000000.000000
5+
557259285.358743
6+
621075822.237074
7+
692200537.706851
8+
771470353.934916
9+
859818036.218455
10+
958283168.803309
11+
1068024387.637287
12+
1190333014.000928
13+
1326648249.442152
14+
1478574110.813123
15+
1647898304.683319
16+
1836613263.223422
17+
2046939589.088547
18+
2281352185.176006
19+
2542609376.725576
20+
2833785368.441067
21+
3158306418.555064
22+
3519991155.495852
23+
3923095511.561430
24+
4372362802.333632
25+
4873079541.115182
26+
5431137645.156317
27+
6053103765.649552
28+
6746296557.296372
29+
7518872796.674251
30+
8379923362.755975
31+
9339580208.980862
32+
10409135585.614670
33+
11601174915.283787
34+
12929724885.225643
35+
14410418498.851995
36+
16060679028.781351
37+
17899925035.909695
38+
19949798866.972221
39+
22234421319.319210
40+
24780675469.538052
41+
27618523005.723427
42+
30781356785.666882
43+
34306393769.506451
44+
38235112950.461609
45+
42613743436.770119
46+
47493808428.070702
47+
52932731487.183456
48+
58994512241.268188
49+
65750479463.313469
50+
73280130395.441559
51+
81672066190.318542
52+
91025034477.977768
53+
101449091325.905701
54+
113066896265.136154
55+
126015155620.881821
56+
140446231131.326813
57+
156529932783.144104
58+
174455516959.973938
59+
194433913416.010376
60+
216700207279.419342
61+
241516405291.241455
62+
269174518830.019562
63+
300000000000.000488
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
echo
2+
----
3+
Count1KBuckets
4+
1.000000
5+
2.000000
6+
4.000000
7+
8.000000
8+
16.000000
9+
32.000000
10+
64.000000
11+
128.000000
12+
256.000000
13+
512.000000
14+
1024.000000

pkg/util/metric/testdata/DataCount16MBuckets

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ echo
22
----
33
DataCount16MBuckets
44
1.000000
5-
2.000000
6-
4.000000
7-
8.000000
8-
17.000000
9-
36.000000
10-
75.000000
11-
155.000000
12-
320.000000
13-
659.000000
14-
1355.000000
15-
2789.000000
16-
5736.000000
17-
11800.000000
18-
24272.000000
19-
49927.000000
20-
102697.000000
21-
211243.000000
22-
434517.000000
23-
893777.000000
24-
1838451.000000
25-
3781592.000000
26-
7778527.000000
5+
2.056945
6+
4.231021
7+
8.702977
8+
17.901542
9+
36.822480
10+
75.741804
11+
155.796700
12+
320.465191
13+
659.179164
14+
1355.895063
15+
2789.001112
16+
5736.820948
17+
11800.323223
18+
24272.611859
19+
49927.419386
20+
102697.938774
21+
211243.976921
22+
434517.170624
23+
893777.774494
24+
1838451.421912
25+
3781592.837932
26+
7778527.200371
2727
16000000.000000
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
echo
2+
----
3+
DataCount16MBuckets
4+
1.000000
5+
2.056945
6+
4.231021
7+
8.702977
8+
17.901542
9+
36.822480
10+
75.741804
11+
155.796700
12+
320.465191
13+
659.179164
14+
1355.895063
15+
2789.001112
16+
5736.820948
17+
11800.323223
18+
24272.611859
19+
49927.419386
20+
102697.938774
21+
211243.976921
22+
434517.170624
23+
893777.774494
24+
1838451.421912
25+
3781592.837932
26+
7778527.200371
27+
16000000.000000
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
echo
2+
----
3+
DataSize16MBBuckets
4+
1000.000000
5+
2000.000000
6+
4000.000000
7+
8000.000000
8+
16000.000000
9+
32000.000000
10+
64000.000000
11+
128000.000000
12+
256000.000000
13+
512000.000000
14+
1024000.000000
15+
2048000.000000
16+
4096000.000000
17+
8192000.000000
18+
16384000.000000

0 commit comments

Comments
 (0)