mlbiscoc commented on code in PR #3835:
URL: https://github.com/apache/solr/pull/3835#discussion_r2491928518


##########
solr/core/src/java/org/apache/solr/handler/admin/MetricsHandler.java:
##########
@@ -122,6 +122,11 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
               + format);
     }
 
+    if (!isEnabled()) {
+      rsp.add("metrics", MetricSnapshots.builder().build());

Review Comment:
   I am just returning an empty response instead of throwing an error on 
metrics being disabled like before. My change here is debatable so any thoughts 
welcome.



##########
solr/core/src/java/org/apache/solr/core/MetricsConfig.java:
##########
@@ -16,133 +16,24 @@
  */
 package org.apache.solr.core;
 
-import java.util.Collections;
-
-/** */
+/**
+ * Configuration for metrics collection in Solr. Currently only supports both 
enabled and disabled
+ * states. TODO: Extend to support more configuration options in the future.
+ */
 public class MetricsConfig {

Review Comment:
   This doesn't do much right now except enable/disable metrics but I would 
expect this to grow in the future.



##########
solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java:
##########
@@ -73,6 +73,8 @@ public class CloudExitableDirectoryReaderTest extends 
SolrCloudTestCase {
 
   @BeforeClass
   public static void setupCluster() throws Exception {
+    System.setProperty("metricsEnabled", "true");

Review Comment:
   Metrics are disabled by default for tests using `MiniSolrCloudCluster` using 
this [config 
here](https://github.com/apache/solr/blob/19ec326349d1f31d6735f3b8c11b793503c77f43/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java#L147).
 Do we want to also disable by default in `SolrTestCaseJ4`?



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