@@ -65,8 +65,11 @@ public class StarRocksSinkManager implements Serializable {
65
65
private transient Counter totalFlushTimeWithoutRetries ;
66
66
private transient Counter totalFlushSucceededTimes ;
67
67
private transient Counter totalFlushFailedTimes ;
68
+ private transient Histogram flushTimeNsWithRetry ;
68
69
private transient Histogram flushTimeNs ;
69
70
private transient Histogram offerTimeNs ;
71
+ private transient Counter totalFlushRetry ;
72
+ private transient Histogram flushRetry ;
70
73
71
74
private transient Counter totalFilteredRows ;
72
75
private transient Histogram commitAndPublishTimeMs ;
@@ -82,8 +85,11 @@ public class StarRocksSinkManager implements Serializable {
82
85
private static final String COUNTER_TOTAL_FLUSH_COST_TIME = "totalFlushTimeNs" ;
83
86
private static final String COUNTER_TOTAL_FLUSH_SUCCEEDED_TIMES = "totalFlushSucceededTimes" ;
84
87
private static final String COUNTER_TOTAL_FLUSH_FAILED_TIMES = "totalFlushFailedTimes" ;
88
+ private static final String HISTOGRAM_FLUSH_TIME_WITH_RETRY = "flushTimeNsWithRetry" ;
85
89
private static final String HISTOGRAM_FLUSH_TIME = "flushTimeNs" ;
86
90
private static final String HISTOGRAM_OFFER_TIME_NS = "offerTimeNs" ;
91
+ private static final String COUNTER_TOTAL_FLUSH_RETRY = "totalFlushRetry" ;
92
+ private static final String HISTOGRAM_FLUSH_RETRY = "flushRetry" ;
87
93
88
94
// from stream load result
89
95
private static final String COUNTER_NUMBER_FILTERED_ROWS = "totalFilteredRows" ;
@@ -143,8 +149,12 @@ public void setRuntimeContext(RuntimeContext runtimeCtx) {
143
149
totalFlushTimeWithoutRetries = runtimeCtx .getMetricGroup ().counter (COUNTER_TOTAL_FLUSH_COST_TIME_WITHOUT_RETRIES );
144
150
totalFlushSucceededTimes = runtimeCtx .getMetricGroup ().counter (COUNTER_TOTAL_FLUSH_SUCCEEDED_TIMES );
145
151
totalFlushFailedTimes = runtimeCtx .getMetricGroup ().counter (COUNTER_TOTAL_FLUSH_FAILED_TIMES );
152
+ flushTimeNsWithRetry = runtimeCtx .getMetricGroup ().histogram (HISTOGRAM_FLUSH_TIME_WITH_RETRY ,
153
+ new DescriptiveStatisticsHistogram (sinkOptions .getSinkHistogramWindowSize ()));
146
154
flushTimeNs = runtimeCtx .getMetricGroup ().histogram (HISTOGRAM_FLUSH_TIME , new DescriptiveStatisticsHistogram (sinkOptions .getSinkHistogramWindowSize ()));
147
155
offerTimeNs = runtimeCtx .getMetricGroup ().histogram (HISTOGRAM_OFFER_TIME_NS , new DescriptiveStatisticsHistogram (sinkOptions .getSinkHistogramWindowSize ()));
156
+ totalFlushRetry = runtimeCtx .getMetricGroup ().counter (COUNTER_TOTAL_FLUSH_RETRY );
157
+ flushRetry = runtimeCtx .getMetricGroup ().histogram (HISTOGRAM_FLUSH_RETRY , new DescriptiveStatisticsHistogram (sinkOptions .getSinkHistogramWindowSize ()));
148
158
149
159
totalFilteredRows = runtimeCtx .getMetricGroup ().counter (COUNTER_NUMBER_FILTERED_ROWS );
150
160
commitAndPublishTimeMs = runtimeCtx .getMetricGroup ().histogram (HISTOGRAM_COMMIT_AND_PUBLISH_TIME_MS , new DescriptiveStatisticsHistogram (sinkOptions .getSinkHistogramWindowSize ()));
@@ -334,6 +344,9 @@ private boolean asyncFlush() throws Exception {
334
344
totalFlushTimeWithoutRetries .inc (System .nanoTime () - start );
335
345
totalFlushSucceededTimes .inc ();
336
346
flushTimeNs .update (System .nanoTime () - start );
347
+ flushTimeNsWithRetry .update (System .nanoTime () - startWithRetries );
348
+ totalFlushRetry .inc (i );
349
+ flushRetry .update (i );
337
350
updateMetricsFromStreamLoadResult (result );
338
351
}
339
352
startScheduler ();
0 commit comments