noblepaul commented on a change in pull request #1951:
URL: https://github.com/apache/lucene-solr/pull/1951#discussion_r500216190



##########
File path: 
solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
##########
@@ -308,19 +318,24 @@ public void testKeyMetrics() throws Exception {
     handler.handleRequestBody(req(CommonParams.QT, "/admin/metrics", 
CommonParams.WT, "json",
         MetricsHandler.KEY_PARAM, key1, MetricsHandler.KEY_PARAM, key2, 
MetricsHandler.KEY_PARAM, key3), resp);
     values = resp.getValues();
-    val = values.findRecursive("metrics", key1);
+    map = new HashMap<>();
+    values.toMap(map);
+    val = Utils.getObjectByPath(map, false, "metrics/" + key1);
     assertNotNull(val);
-    val = values.findRecursive("metrics", key2);
+    val = Utils.getObjectByPath(map, true, "metrics/" + key2);
     assertNotNull(val);
-    val = values.findRecursive("metrics", key3);
+    val = Utils.getObjectByPath(map, true, "metrics/" + key3);
     assertNotNull(val);
 
     String key4 = "solr.core.collection1:QUERY./select.requestTimes:1minRate";
     resp = new SolrQueryResponse();
     handler.handleRequestBody(req(CommonParams.QT, "/admin/metrics", 
CommonParams.WT, "json",
         MetricsHandler.KEY_PARAM, key4), resp);
     values = resp.getValues();
-    val = values.findRecursive("metrics", key4);
+    map = new HashMap<>();

Review comment:
       There is no need to convert this to `Map`.
   
   `values._get()` can fetch nested values




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

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



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

Reply via email to