n3nash commented on a change in pull request #2152:
URL: https://github.com/apache/hudi/pull/2152#discussion_r502179584
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/Metrics.java
##########
@@ -68,8 +69,20 @@ private void reportAndCloseReporter() {
}
}
+ private void reportAndFlushMetrics() {
+ try {
+ LOG.info("Reporting and flushing all metrics");
+
+ this.registerHoodieCommonMetrics();
+ this.reporter.report();
+ this.registry.getNames().forEach(name -> this.registry.remove(name));
+ } catch (Exception e) {
+ Metrics.LOG.warn((Object)"Error while reporting and flushing metrics",
(Throwable)e);
Review comment:
Can we do LOG.error ?
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/Metrics.java
##########
@@ -97,6 +110,14 @@ public static synchronized void shutdown() {
initialized = false;
}
+ public static synchronized void flush() {
+ if (!Metrics.initialized) {
+ return;
Review comment:
What should be the right expectation if it's not initialized ? Simply
returning gives a false impression to the client that it's flushed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]