kfaraz commented on code in PR #18876:
URL: https://github.com/apache/druid/pull/18876#discussion_r2652320394


##########
processing/src/test/java/org/apache/druid/java/util/metrics/StubServiceEmitter.java:
##########
@@ -41,18 +44,32 @@
  */
 public class StubServiceEmitter extends ServiceEmitter implements 
MetricsVerifier
 {
+  public static final String TYPE = "stub";
+
   private final Deque<Event> events = new ConcurrentLinkedDeque<>();
   private final Deque<AlertEvent> alertEvents = new ConcurrentLinkedDeque<>();
   private final ConcurrentHashMap<String, Deque<ServiceMetricEvent>> 
metricEvents = new ConcurrentHashMap<>();
 
   public StubServiceEmitter()
   {
-    super("testing", "localhost", null);
+    this("testing", "localhost");
   }
 
+  /**
+   * Initialize a stub service emitter and auto-{@link #start()}  it for test 
convenience.
+   */
   public StubServiceEmitter(String service, String host)
   {
-    super(service, host, null);
+    this(service, host, new NoopTaskHolder());
+    super.start();
+  }
+
+  /**
+   * Initialize a stub service emitter. Tests must explicitly call {@link 
#start()}.
+   */
+  public StubServiceEmitter(String service, String host, TaskHolder taskHolder)

Review Comment:
   > You could also add a short test method in any of the existing tests to 
verify the new dimensions.
   
   Oh, I suppose this would require MMs. You could add a metric verification in 
the `KubernetesTaskRunnerDockerTest` since that test runs peons and also uses 
an event collector + latchable emitter combo.



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