blackmwk commented on code in PR #3283:
URL: https://github.com/apache/iceberg-rust/pull/3283#discussion_r4440848808


##########
crates/iceberg/src/arrow/scan_metrics.rs:
##########
@@ -52,23 +52,74 @@ impl<F: FileRead> FileRead for CountingFileRead<F> {
 /// Metrics collected during an Iceberg scan.
 #[derive(Clone, Debug)]
 pub struct ScanMetrics {
-    bytes_read: Arc<AtomicU64>,
+    data_bytes_read: Arc<AtomicU64>,
+    delete_bytes_read: Arc<AtomicU64>,
+    data_files_opened: Arc<AtomicU64>,
+    delete_files_opened: Arc<AtomicU64>,
+    rows_emitted: Arc<AtomicU64>,

Review Comment:
   I prefer to do have sth as following:
   ```rust
   struct ScanMtricsInnter {
      data_bytes_read: AtomicU64,
       ....
   }
   
   pub struct ScanMetrics {
     inner: Arc<ScanMtricsInnter>
   }
   
   impl ScanMetrics {
     pub(crate) fn add_data_byte_read(&self, v: u64) { 
   
     ...
   }
   }
   ```
   
   The benefit of this approach is the the clone only increment Arc's inner 
counter once.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to