You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "akshat0395 (via GitHub)" <gi...@apache.org> on 2023/08/28 17:36:06 UTC
[GitHub] [hive] akshat0395 commented on a diff in pull request #4630: HIVE-17350: metrics errors when retrying HS2 startup
akshat0395 commented on code in PR #4630:
URL: https://github.com/apache/hive/pull/4630#discussion_r1307718786
##########
standalone-metastore/metastore-common/src/test/java/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleReportersConf.java:
##########
@@ -149,4 +148,30 @@ public void testNoFallbackOnIncorrectConf() throws Exception {
Assert.assertFalse(jsonReportFile.exists());
}
+
+ /**
+ * Tests if MetricsFactory is initialised properly, if in case Metrics2Reporter is tried to add more than once.
+ *
+ * **/
+ @Test
+ public void testMetricsFactoryInitMetrics2ReporterAddedTwice() throws Exception {
+ if(MetricsFactory.getInstance() != null) {
+ MetricsFactory.close();
+ }
+ Configuration conf = new Configuration();
+
+ jsonReportFile = File.createTempFile("TestCodahaleMetrics", ".json");
+ System.out.println("Json metrics saved in " + jsonReportFile.getAbsolutePath());
Review Comment:
Can we use logger here rather than system out
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org