jerqi commented on code in PR #9010:
URL: https://github.com/apache/gravitino/pull/9010#discussion_r2522010563
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/metrics/IcebergMetricsManager.java:
##########
@@ -196,11 +206,35 @@ private void logMetrics(String message, MetricsReport
metricsReport) {
LOG.info("{} {}.", message,
icebergMetricsFormatter.toPrintableString(metricsReport));
}
- private void doRecordMetric(MetricsReport metricsReport) {
+ private void doRecordMetric(String catalog, Namespace namespace,
MetricsReport metricsReport) {
try {
- icebergMetricsStore.recordMetric(metricsReport);
+ icebergMetricsStore.recordMetric(catalog, namespace, metricsReport);
} catch (Exception e) {
LOG.warn("Write Iceberg metrics failed.", e);
}
}
+
+ private static class MetricsReportWrapper {
+ private final String catalog;
+ private final Namespace namespace;
+ private final MetricsReport metricsReport;
+
+ public MetricsReportWrapper(String catalog, Namespace namespace,
MetricsReport metricsReport) {
+ this.catalog = catalog;
+ this.namespace = namespace;
+ this.metricsReport = metricsReport;
+ }
+
+ public Namespace getNamespace() {
Review Comment:
Notice you are using the code
```
IcebergMetricsStore getIcebergMetricsStore() {
return icebergMetricsStore;
}
```
I prefer using `getXXX` here to keep consistent with other places in one
class.
--
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]