xanderbailey commented on code in PR #3709:
URL: https://github.com/apache/iceberg-rust/pull/3709#discussion_r4637255549


##########
crates/iceberg/src/metrics.rs:
##########
@@ -0,0 +1,212 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Metrics reporting API for Iceberg table operations.
+
+use std::collections::HashMap;
+use std::fmt::Debug;
+use std::time::Duration;
+
+use async_trait::async_trait;
+
+use crate::TableIdent;
+use crate::expr::Predicate;
+use crate::spec::SchemaId;
+
+/// Receives metrics reports for completed table operations.
+///
+/// Implementations must handle reporting failures internally so they do not 
affect the operation
+/// that produced the report.
+#[async_trait]
+pub trait MetricsReporter: Debug + Send + Sync {
+    /// Reports the metrics for a completed table operation.
+    async fn report(&self, report: &MetricsReport);
+}
+
+/// A metrics report for an Iceberg table operation.
+#[derive(Debug)]
+#[non_exhaustive]
+pub enum MetricsReport {
+    /// A report produced by planning a table scan.
+    Scan(ScanReport),
+}
+
+/// Information and metrics collected while planning a table scan.
+#[derive(Debug)]
+pub struct ScanReport {
+    pub(crate) table_ident: TableIdent,

Review Comment:
   
https://github.com/apache/iceberg/blob/95aac2f4b100db7f8f37563d58d09daf01196d47/core/src/main/java/org/apache/iceberg/metrics/ScanReport.java#L30
 Java just takes the name here, is there a reason to take the ident out of 
interest? 



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