@@ -69,6 +69,7 @@ type AggMetrics struct {
69
69
ParallelIOPendingRows * aggmetric.AggGauge
70
70
ParallelIOResultQueueNanos * aggmetric.AggHistogram
71
71
ParallelIOInFlightKeys * aggmetric.AggGauge
72
+ ParallelIOWorkers * aggmetric.AggGauge
72
73
SinkIOInflight * aggmetric.AggGauge
73
74
SinkBackpressureNanos * aggmetric.AggHistogram
74
75
CommitLatency * aggmetric.AggHistogram
@@ -128,6 +129,7 @@ type metricsRecorder interface {
128
129
recordSizeBasedFlush ()
129
130
newParallelIOMetricsRecorder () parallelIOMetricsRecorder
130
131
recordSinkIOInflightChange (int64 )
132
+ recordParallelIOWorkers (int64 )
131
133
recordSinkBackpressure (time.Duration )
132
134
makeCloudstorageFileAllocCallback () func (delta int64 )
133
135
getKafkaThrottlingMetrics (* cluster.Settings ) metrics.Histogram
@@ -158,6 +160,7 @@ type sliMetrics struct {
158
160
ParallelIOPendingRows * aggmetric.Gauge
159
161
ParallelIOResultQueueNanos * aggmetric.Histogram
160
162
ParallelIOInFlightKeys * aggmetric.Gauge
163
+ ParallelIOWorkers * aggmetric.Gauge
161
164
SinkIOInflight * aggmetric.Gauge
162
165
SinkBackpressureNanos * aggmetric.Histogram
163
166
CommitLatency * aggmetric.Histogram
@@ -626,6 +629,14 @@ func (m *sliMetrics) recordSinkIOInflightChange(delta int64) {
626
629
m .SinkIOInflight .Inc (delta )
627
630
}
628
631
632
+ func (m * sliMetrics ) recordParallelIOWorkers (n int64 ) {
633
+ if m == nil {
634
+ return
635
+ }
636
+
637
+ m .ParallelIOWorkers .Update (n )
638
+ }
639
+
629
640
func (m * sliMetrics ) recordSinkBackpressure (duration time.Duration ) {
630
641
if m == nil {
631
642
return
@@ -712,6 +723,10 @@ func (w *wrappingCostController) recordSinkIOInflightChange(delta int64) {
712
723
w .inner .recordSinkIOInflightChange (delta )
713
724
}
714
725
726
+ func (w * wrappingCostController ) recordParallelIOWorkers (n int64 ) {
727
+ w .inner .recordParallelIOWorkers (n )
728
+ }
729
+
715
730
func (w * wrappingCostController ) recordSinkBackpressure (duration time.Duration ) {
716
731
w .inner .recordSinkBackpressure (duration )
717
732
}
@@ -992,6 +1007,12 @@ func newAggregateMetrics(histogramWindow time.Duration, lookup *cidr.Lookup) *Ag
992
1007
Measurement : "Keys" ,
993
1008
Unit : metric .Unit_COUNT ,
994
1009
}
1010
+ metaChangefeedParallelIOWorkers := metric.Metadata {
1011
+ Name : "changefeed.parallel_io_workers" ,
1012
+ Help : "The number of workers in the ParallelIO" ,
1013
+ Measurement : "Workers" ,
1014
+ Unit : metric .Unit_COUNT ,
1015
+ }
995
1016
metaChangefeedSinkIOInflight := metric.Metadata {
996
1017
Name : "changefeed.sink_io_inflight" ,
997
1018
Help : "The number of keys currently inflight as IO requests being sent to the sink" ,
@@ -1138,6 +1159,7 @@ func newAggregateMetrics(histogramWindow time.Duration, lookup *cidr.Lookup) *Ag
1138
1159
SigFigs : 2 ,
1139
1160
BucketConfig : metric .ChangefeedBatchLatencyBuckets ,
1140
1161
}),
1162
+ ParallelIOWorkers : b .Gauge (metaChangefeedParallelIOWorkers ),
1141
1163
BatchHistNanos : b .Histogram (metric.HistogramOptions {
1142
1164
Metadata : metaChangefeedBatchHistNanos ,
1143
1165
Duration : histogramWindow ,
@@ -1245,6 +1267,7 @@ func (a *AggMetrics) getOrCreateScope(scope string) (*sliMetrics, error) {
1245
1267
ParallelIOPendingRows : a .ParallelIOPendingRows .AddChild (scope ),
1246
1268
ParallelIOResultQueueNanos : a .ParallelIOResultQueueNanos .AddChild (scope ),
1247
1269
ParallelIOInFlightKeys : a .ParallelIOInFlightKeys .AddChild (scope ),
1270
+ ParallelIOWorkers : a .ParallelIOWorkers .AddChild (scope ),
1248
1271
SinkIOInflight : a .SinkIOInflight .AddChild (scope ),
1249
1272
SinkBackpressureNanos : a .SinkBackpressureNanos .AddChild (scope ),
1250
1273
CommitLatency : a .CommitLatency .AddChild (scope ),
0 commit comments