fresh-borzoni commented on code in PR #609:
URL: https://github.com/apache/fluss-rust/pull/609#discussion_r3369640804


##########
crates/fluss/src/client/write/sender.rs:
##########
@@ -371,8 +376,15 @@ impl Sender {
                 }
             };
 
-            // let's put in back into records_by_bucket
-            // since response handle will use it.
+            // Record attempted-send per-batch metrics after
+            // `build_write_request` (so `estimated_size_in_bytes` and
+            // `record_count` reflect the final serialized batch), before the
+            // actual request round-trip. Retries therefore contribute one
+            // sample per send attempt.
+            self.record_request_batch_metrics(&request_batches);

Review Comment:
   If get_connection fails, we bail out before reaching 
record_request_batch_metrics, so those batches never get counted in 
records_send_total / bytes_send_total. 
   
   Java still counts them since it updates metrics over the whole drained set 
regardless of send outcome. Arguably ours is even more accurate as we only 
count batches that actually got serialized and dispatched, but if we wish this, 
we need to change the semantics in Java first.
   
   For now it's better to match.



##########
crates/fluss/src/client/write/sender.rs:
##########
@@ -1058,6 +1108,56 @@ mod tests {
         Ok((batch, result_handle))
     }
 
+    fn build_cluster_arc_with_port(

Review Comment:
   utils?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to