dsmiley commented on code in PR #3430:
URL: https://github.com/apache/solr/pull/3430#discussion_r2220729843


##########
solr/core/src/test/org/apache/solr/core/SolrCoreTest.java:
##########
@@ -354,15 +353,19 @@ public void testCoreInitDeadlockMetrics() throws 
Exception {
     executor.execute(
         () -> {
           while (!created.get()) {
-            var metrics =
-                metricManager.getMetrics(
-                    "solr.core." + coreName,
-                    
MetricFilter.startsWith(SolrInfoBean.Category.INDEX.toString()));
-            for (var m : metrics.values()) {
-              if (m instanceof Gauge) {
-                var v = ((Gauge<?>) m).getValue();
-                atLeastOnePoll.compareAndSet(false, v != null);
-              }
+            var reader = 
SolrMetricTestUtils.getPrometheusMetricReader(h.getCore());
+
+            var datapoint =
+                SolrMetricTestUtils.getGaugeOpDatapoint(
+                    reader,
+                    "solr_core_index_size_bytes",
+                    SolrMetricTestUtils.getStandaloneLabelsBase(h.getCore())
+                        .get()

Review Comment:
   I suspect it'd be simpler to remove the supplier and use an Attribute 
Builder.  Methods like above would be `newStandaloneLabelsBuilder`.  I hate 
"get" methods that in fact return new things.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to