Skip to content

Commit 62ce929

Browse files
authored
Widen network stat (#12)
* Widen network stat Change total_bytes, tuple_bytes, chunks in NetworkStat message to be uint64 as Greenplum uses 64-bit counters.
1 parent 7783ffc commit 62ce929

5 files changed

Lines changed: 57 additions & 172 deletions

File tree

api/proto/common/yagpcc_metrics.pb.go

Lines changed: 12 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/proto/common/yagpcc_metrics.proto

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,27 +252,21 @@ message NetworkStat {
252252
//
253253
// Importance: major
254254
// Aggregation: sum
255-
uint32 total_bytes = 1;
255+
uint64 total_bytes = 1;
256256

257257
// tuple_bytes: total number of tuples only bytes (without headers) that all of backend processes
258258
// associated with query or session sent/received to/from the network layer.
259259
//
260260
// Importance: minor
261261
// Aggregation: sum
262-
uint32 tuple_bytes = 2;
262+
uint64 tuple_bytes = 2;
263263

264264
// chunks: total number of chunks (tuples only) that all of backend processes
265265
// associated with query or session sent/received to/from the network layer.
266266
//
267267
// Importance: normal
268268
// Aggregation: sum
269-
uint32 chunks = 3;
270-
271-
// the stats here is the same except uses uint64, uint32 is too snal for aggregated stat
272-
uint64 total_bytes_long = 4;
273-
uint64 tuple_bytes_long = 5;
274-
uint64 chunks_long = 6;
275-
269+
uint64 chunks = 3;
276270
}
277271

278272
// InterconnectStat: detailed interconnect statistics.

internal/grpc/get_master_info.go

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
10651065

10661066
left, right := uint64(0), uint64(0)
10671067
if p.TotalMetrics != nil && p.TotalMetrics.Instrumentation != nil && p.TotalMetrics.Instrumentation.Sent != nil {
1068-
left = max(uint64(p.TotalMetrics.Instrumentation.Sent.TotalBytes), p.TotalMetrics.Instrumentation.Sent.TotalBytesLong)
1068+
left = p.TotalMetrics.Instrumentation.Sent.TotalBytes
10691069
}
10701070
if q.TotalMetrics != nil && q.TotalMetrics.Instrumentation != nil && q.TotalMetrics.Instrumentation.Sent != nil {
1071-
right = max(uint64(q.TotalMetrics.Instrumentation.Sent.TotalBytes), q.TotalMetrics.Instrumentation.Sent.TotalBytesLong)
1071+
right = q.TotalMetrics.Instrumentation.Sent.TotalBytes
10721072
}
10731073
if less(ms.Fields[k].Order, left, right) {
10741074
return true
@@ -1080,10 +1080,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
10801080

10811081
left, right := uint64(0), uint64(0)
10821082
if p.TotalMetrics != nil && p.TotalMetrics.Instrumentation != nil && p.TotalMetrics.Instrumentation.Sent != nil {
1083-
left = max(uint64(p.TotalMetrics.Instrumentation.Sent.TupleBytes), p.TotalMetrics.Instrumentation.Sent.TupleBytesLong)
1083+
left = p.TotalMetrics.Instrumentation.Sent.TupleBytes
10841084
}
10851085
if q.TotalMetrics != nil && q.TotalMetrics.Instrumentation != nil && q.TotalMetrics.Instrumentation.Sent != nil {
1086-
right = max(uint64(q.TotalMetrics.Instrumentation.Sent.TupleBytes), q.TotalMetrics.Instrumentation.Sent.TupleBytesLong)
1086+
right = q.TotalMetrics.Instrumentation.Sent.TupleBytes
10871087
}
10881088
if less(ms.Fields[k].Order, left, right) {
10891089
return true
@@ -1095,10 +1095,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
10951095

10961096
left, right := uint64(0), uint64(0)
10971097
if p.TotalMetrics != nil && p.TotalMetrics.Instrumentation != nil && p.TotalMetrics.Instrumentation.Sent != nil {
1098-
left = max(uint64(p.TotalMetrics.Instrumentation.Sent.Chunks), p.TotalMetrics.Instrumentation.Sent.ChunksLong)
1098+
left = p.TotalMetrics.Instrumentation.Sent.Chunks
10991099
}
11001100
if q.TotalMetrics != nil && q.TotalMetrics.Instrumentation != nil && q.TotalMetrics.Instrumentation.Sent != nil {
1101-
right = max(uint64(q.TotalMetrics.Instrumentation.Sent.Chunks), q.TotalMetrics.Instrumentation.Sent.ChunksLong)
1101+
right = q.TotalMetrics.Instrumentation.Sent.Chunks
11021102
}
11031103
if less(ms.Fields[k].Order, left, right) {
11041104
return true
@@ -1110,10 +1110,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
11101110

11111111
left, right := uint64(0), uint64(0)
11121112
if p.TotalMetrics != nil && p.TotalMetrics.Instrumentation != nil && p.TotalMetrics.Instrumentation.Received != nil {
1113-
left = max(uint64(p.TotalMetrics.Instrumentation.Received.TotalBytes), p.TotalMetrics.Instrumentation.Received.TotalBytesLong)
1113+
left = p.TotalMetrics.Instrumentation.Received.TotalBytes
11141114
}
11151115
if q.TotalMetrics != nil && q.TotalMetrics.Instrumentation != nil && q.TotalMetrics.Instrumentation.Received != nil {
1116-
right = max(uint64(q.TotalMetrics.Instrumentation.Received.TotalBytes), q.TotalMetrics.Instrumentation.Received.TotalBytesLong)
1116+
right = q.TotalMetrics.Instrumentation.Received.TotalBytes
11171117
}
11181118
if less(ms.Fields[k].Order, left, right) {
11191119
return true
@@ -1125,10 +1125,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
11251125

11261126
left, right := uint64(0), uint64(0)
11271127
if p.TotalMetrics != nil && p.TotalMetrics.Instrumentation != nil && p.TotalMetrics.Instrumentation.Received != nil {
1128-
left = max(uint64(p.TotalMetrics.Instrumentation.Received.TupleBytes), p.TotalMetrics.Instrumentation.Received.TupleBytesLong)
1128+
left = p.TotalMetrics.Instrumentation.Received.TupleBytes
11291129
}
11301130
if q.TotalMetrics != nil && q.TotalMetrics.Instrumentation != nil && q.TotalMetrics.Instrumentation.Received != nil {
1131-
right = max(uint64(q.TotalMetrics.Instrumentation.Received.TupleBytes), q.TotalMetrics.Instrumentation.Received.TupleBytesLong)
1131+
right = q.TotalMetrics.Instrumentation.Received.TupleBytes
11321132
}
11331133
if less(ms.Fields[k].Order, left, right) {
11341134
return true
@@ -1140,10 +1140,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
11401140

11411141
left, right := uint64(0), uint64(0)
11421142
if p.TotalMetrics != nil && p.TotalMetrics.Instrumentation != nil && p.TotalMetrics.Instrumentation.Received != nil {
1143-
left = max(uint64(p.TotalMetrics.Instrumentation.Received.Chunks), p.TotalMetrics.Instrumentation.Received.ChunksLong)
1143+
left = p.TotalMetrics.Instrumentation.Received.Chunks
11441144
}
11451145
if q.TotalMetrics != nil && q.TotalMetrics.Instrumentation != nil && q.TotalMetrics.Instrumentation.Received != nil {
1146-
right = max(uint64(q.TotalMetrics.Instrumentation.Received.Chunks), q.TotalMetrics.Instrumentation.Received.ChunksLong)
1146+
right = q.TotalMetrics.Instrumentation.Received.Chunks
11471147
}
11481148
if less(ms.Fields[k].Order, left, right) {
11491149
return true
@@ -1650,10 +1650,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
16501650

16511651
left, right := uint64(0), uint64(0)
16521652
if p.LastMetrics != nil && p.LastMetrics.Instrumentation != nil && p.LastMetrics.Instrumentation.Sent != nil {
1653-
left = max(uint64(p.LastMetrics.Instrumentation.Sent.TotalBytes), p.LastMetrics.Instrumentation.Sent.TotalBytesLong)
1653+
left = p.LastMetrics.Instrumentation.Sent.TotalBytes
16541654
}
16551655
if q.LastMetrics != nil && q.LastMetrics.Instrumentation != nil && q.LastMetrics.Instrumentation.Sent != nil {
1656-
right = max(uint64(q.LastMetrics.Instrumentation.Sent.TotalBytes), q.LastMetrics.Instrumentation.Sent.TotalBytesLong)
1656+
right = q.LastMetrics.Instrumentation.Sent.TotalBytes
16571657
}
16581658
if less(ms.Fields[k].Order, left, right) {
16591659
return true
@@ -1665,10 +1665,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
16651665

16661666
left, right := uint64(0), uint64(0)
16671667
if p.LastMetrics != nil && p.LastMetrics.Instrumentation != nil && p.LastMetrics.Instrumentation.Sent != nil {
1668-
left = max(uint64(p.LastMetrics.Instrumentation.Sent.TupleBytes), p.LastMetrics.Instrumentation.Sent.TupleBytesLong)
1668+
left = p.LastMetrics.Instrumentation.Sent.TupleBytes
16691669
}
16701670
if q.LastMetrics != nil && q.LastMetrics.Instrumentation != nil && q.LastMetrics.Instrumentation.Sent != nil {
1671-
right = max(uint64(q.LastMetrics.Instrumentation.Sent.TupleBytes), q.LastMetrics.Instrumentation.Sent.TupleBytesLong)
1671+
right = q.LastMetrics.Instrumentation.Sent.TupleBytes
16721672
}
16731673
if less(ms.Fields[k].Order, left, right) {
16741674
return true
@@ -1680,10 +1680,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
16801680

16811681
left, right := uint64(0), uint64(0)
16821682
if p.LastMetrics != nil && p.LastMetrics.Instrumentation != nil && p.LastMetrics.Instrumentation.Sent != nil {
1683-
left = max(uint64(p.LastMetrics.Instrumentation.Sent.Chunks), p.LastMetrics.Instrumentation.Sent.ChunksLong)
1683+
left = p.LastMetrics.Instrumentation.Sent.Chunks
16841684
}
16851685
if q.LastMetrics != nil && q.LastMetrics.Instrumentation != nil && q.LastMetrics.Instrumentation.Sent != nil {
1686-
right = max(uint64(q.LastMetrics.Instrumentation.Sent.Chunks), q.LastMetrics.Instrumentation.Sent.ChunksLong)
1686+
right = q.LastMetrics.Instrumentation.Sent.Chunks
16871687
}
16881688
if less(ms.Fields[k].Order, left, right) {
16891689
return true
@@ -1695,10 +1695,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
16951695

16961696
left, right := uint64(0), uint64(0)
16971697
if p.LastMetrics != nil && p.LastMetrics.Instrumentation != nil && p.LastMetrics.Instrumentation.Received != nil {
1698-
left = max(uint64(p.LastMetrics.Instrumentation.Received.TotalBytes), p.LastMetrics.Instrumentation.Received.TotalBytesLong)
1698+
left = p.LastMetrics.Instrumentation.Received.TotalBytes
16991699
}
17001700
if q.LastMetrics != nil && q.LastMetrics.Instrumentation != nil && q.LastMetrics.Instrumentation.Received != nil {
1701-
right = max(uint64(q.LastMetrics.Instrumentation.Received.TotalBytes), q.LastMetrics.Instrumentation.Received.TotalBytesLong)
1701+
right = q.LastMetrics.Instrumentation.Received.TotalBytes
17021702
}
17031703
if less(ms.Fields[k].Order, left, right) {
17041704
return true
@@ -1710,10 +1710,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
17101710

17111711
left, right := uint64(0), uint64(0)
17121712
if p.LastMetrics != nil && p.LastMetrics.Instrumentation != nil && p.LastMetrics.Instrumentation.Received != nil {
1713-
left = max(uint64(p.LastMetrics.Instrumentation.Received.TupleBytes), p.LastMetrics.Instrumentation.Received.TupleBytesLong)
1713+
left = p.LastMetrics.Instrumentation.Received.TupleBytes
17141714
}
17151715
if q.LastMetrics != nil && q.LastMetrics.Instrumentation != nil && q.LastMetrics.Instrumentation.Received != nil {
1716-
right = max(uint64(q.LastMetrics.Instrumentation.Received.TupleBytes), q.LastMetrics.Instrumentation.Received.TupleBytesLong)
1716+
right = q.LastMetrics.Instrumentation.Received.TupleBytes
17171717
}
17181718
if less(ms.Fields[k].Order, left, right) {
17191719
return true
@@ -1725,10 +1725,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
17251725

17261726
left, right := uint64(0), uint64(0)
17271727
if p.LastMetrics != nil && p.LastMetrics.Instrumentation != nil && p.LastMetrics.Instrumentation.Received != nil {
1728-
left = max(uint64(p.LastMetrics.Instrumentation.Received.Chunks), p.LastMetrics.Instrumentation.Received.ChunksLong)
1728+
left = p.LastMetrics.Instrumentation.Received.Chunks
17291729
}
17301730
if q.LastMetrics != nil && q.LastMetrics.Instrumentation != nil && q.LastMetrics.Instrumentation.Received != nil {
1731-
right = max(uint64(q.LastMetrics.Instrumentation.Received.Chunks), q.LastMetrics.Instrumentation.Received.ChunksLong)
1731+
right = q.LastMetrics.Instrumentation.Received.Chunks
17321732
}
17331733
if less(ms.Fields[k].Order, left, right) {
17341734
return true
@@ -2235,10 +2235,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
22352235

22362236
left, right := uint64(0), uint64(0)
22372237
if p.QueryMetrics != nil && p.QueryMetrics.Instrumentation != nil && p.QueryMetrics.Instrumentation.Sent != nil {
2238-
left = max(uint64(p.QueryMetrics.Instrumentation.Sent.TotalBytes), p.QueryMetrics.Instrumentation.Sent.TotalBytesLong)
2238+
left = p.QueryMetrics.Instrumentation.Sent.TotalBytes
22392239
}
22402240
if q.QueryMetrics != nil && q.QueryMetrics.Instrumentation != nil && q.QueryMetrics.Instrumentation.Sent != nil {
2241-
right = max(uint64(q.QueryMetrics.Instrumentation.Sent.TotalBytes), q.QueryMetrics.Instrumentation.Sent.TotalBytesLong)
2241+
right = q.QueryMetrics.Instrumentation.Sent.TotalBytes
22422242
}
22432243
if less(ms.Fields[k].Order, left, right) {
22442244
return true
@@ -2250,10 +2250,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
22502250

22512251
left, right := uint64(0), uint64(0)
22522252
if p.QueryMetrics != nil && p.QueryMetrics.Instrumentation != nil && p.QueryMetrics.Instrumentation.Sent != nil {
2253-
left = max(uint64(p.QueryMetrics.Instrumentation.Sent.TupleBytes), p.QueryMetrics.Instrumentation.Sent.TupleBytesLong)
2253+
left = p.QueryMetrics.Instrumentation.Sent.TupleBytes
22542254
}
22552255
if q.QueryMetrics != nil && q.QueryMetrics.Instrumentation != nil && q.QueryMetrics.Instrumentation.Sent != nil {
2256-
right = max(uint64(q.QueryMetrics.Instrumentation.Sent.TupleBytes), q.QueryMetrics.Instrumentation.Sent.TupleBytesLong)
2256+
right = q.QueryMetrics.Instrumentation.Sent.TupleBytes
22572257
}
22582258
if less(ms.Fields[k].Order, left, right) {
22592259
return true
@@ -2265,10 +2265,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
22652265

22662266
left, right := uint64(0), uint64(0)
22672267
if p.QueryMetrics != nil && p.QueryMetrics.Instrumentation != nil && p.QueryMetrics.Instrumentation.Sent != nil {
2268-
left = max(uint64(p.QueryMetrics.Instrumentation.Sent.Chunks), p.QueryMetrics.Instrumentation.Sent.ChunksLong)
2268+
left = p.QueryMetrics.Instrumentation.Sent.Chunks
22692269
}
22702270
if q.QueryMetrics != nil && q.QueryMetrics.Instrumentation != nil && q.QueryMetrics.Instrumentation.Sent != nil {
2271-
right = max(uint64(q.QueryMetrics.Instrumentation.Sent.Chunks), q.QueryMetrics.Instrumentation.Sent.ChunksLong)
2271+
right = q.QueryMetrics.Instrumentation.Sent.Chunks
22722272
}
22732273
if less(ms.Fields[k].Order, left, right) {
22742274
return true
@@ -2280,10 +2280,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
22802280

22812281
left, right := uint64(0), uint64(0)
22822282
if p.QueryMetrics != nil && p.QueryMetrics.Instrumentation != nil && p.QueryMetrics.Instrumentation.Received != nil {
2283-
left = max(uint64(p.QueryMetrics.Instrumentation.Received.TotalBytes), p.QueryMetrics.Instrumentation.Received.TotalBytesLong)
2283+
left = p.QueryMetrics.Instrumentation.Received.TotalBytes
22842284
}
22852285
if q.QueryMetrics != nil && q.QueryMetrics.Instrumentation != nil && q.QueryMetrics.Instrumentation.Received != nil {
2286-
right = max(uint64(q.QueryMetrics.Instrumentation.Received.TotalBytes), q.QueryMetrics.Instrumentation.Received.TotalBytesLong)
2286+
right = q.QueryMetrics.Instrumentation.Received.TotalBytes
22872287
}
22882288
if less(ms.Fields[k].Order, left, right) {
22892289
return true
@@ -2295,10 +2295,10 @@ func (ms *MultipleSorter) Less(i, j int) bool {
22952295

22962296
left, right := uint64(0), uint64(0)
22972297
if p.QueryMetrics != nil && p.QueryMetrics.Instrumentation != nil && p.QueryMetrics.Instrumentation.Received != nil {
2298-
left = max(uint64(p.QueryMetrics.Instrumentation.Received.TupleBytes), p.QueryMetrics.Instrumentation.Received.TupleBytesLong)
2298+
left = p.QueryMetrics.Instrumentation.Received.TupleBytes
22992299
}
23002300
if q.QueryMetrics != nil && q.QueryMetrics.Instrumentation != nil && q.QueryMetrics.Instrumentation.Received != nil {
2301-
right = max(uint64(q.QueryMetrics.Instrumentation.Received.TupleBytes), q.QueryMetrics.Instrumentation.Received.TupleBytesLong)
2301+
right = q.QueryMetrics.Instrumentation.Received.TupleBytes
23022302
}
23032303
if less(ms.Fields[k].Order, left, right) {
23042304
return true

0 commit comments

Comments
 (0)