github-advanced-security[bot] commented on code in PR #17472:
URL: https://github.com/apache/druid/pull/17472#discussion_r1841215946


##########
processing/src/test/java/org/apache/druid/java/util/metrics/JvmMonitorTest.java:
##########
@@ -56,6 +57,30 @@
     }
   }
 
+  @Test(timeout = 60_000L)
+  public void testGcEventDurationMetrics() throws InterruptedException
+  {
+    GcEventDurationTrackingEmitter emitter = new 
GcEventDurationTrackingEmitter();
+
+    final ServiceEmitter serviceEmitter = new ServiceEmitter("test", 
"localhost", emitter);
+    serviceEmitter.start();
+    final JvmMonitor jvmMonitor = new JvmMonitor();
+    // skip tests if gc counters fail to initialize with this JDK
+    Assume.assumeNotNull(jvmMonitor.gcEventCollector);
+
+    while (true) {
+      // generate some garbage to see gc events occur
+      @SuppressWarnings("unused")
+      byte[] b = new byte[1024 * 1024 * 50];

Review Comment:
   ## Unread local variable
   
   Variable 'byte\[\] b' is never read.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/8462)



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