[HUDI-1305] Added an API to shutdown and remove the metrics reporter. (#2132)
This helps in removing reporter once the test has complete. Prevents log pollution from un-necessary metric logs. - Added an API to shutdown the metrics reporter after tests.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package org.apache.hudi.metrics;
|
||||
|
||||
import org.apache.hudi.config.HoodieWriteConfig;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -38,6 +39,11 @@ public class TestHoodieConsoleMetrics {
|
||||
new HoodieMetrics(config, "raw_table");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void stop() {
|
||||
Metrics.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegisterGauge() {
|
||||
registerGauge("metric1", 123L);
|
||||
|
||||
Reference in New Issue
Block a user