You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/08/16 04:34:10 UTC
[GitHub] [solr] noblepaul commented on a diff in pull request #972: SOLR-16337: implement Zk metrics
noblepaul commented on code in PR #972:
URL: https://github.com/apache/solr/pull/972#discussion_r946327421
##########
solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java:
##########
@@ -216,4 +223,65 @@ public void testCoreContainerMetrics() {
Gauge<?> g = (Gauge<?>) metrics.get("CONTAINER.fs.path");
assertEquals(g.getValue(), cc.getSolrHome());
}
+
+ @Test
+ public void testZkMetrics() throws Exception {
+ System.setProperty("metricsEnabled", "true");
+ MiniSolrCloudCluster cluster =
+ new MiniSolrCloudCluster.Builder(3, createTempDir())
+ .withJettyConfig(jetty -> jetty.enableV2(true))
+ .addConfig("conf", configset("conf2"))
+ .configure();
+ System.clearProperty("metricsEnabled");
+ try {
+ JettySolrRunner j = cluster.getRandomJetty(random());
+ String url = j.getBaseUrl() + "/admin/metrics?key=solr.node:CONTAINER.zkClient&wt=json";
+ HttpClient httpClient = ((HttpSolrClient) j.newClient()).getHttpClient();
+ @SuppressWarnings("unchecked")
+ Map<String, Object> zkMmetrics =
+ (Map<String, Object>)
+ Utils.getObjectByPath(
+ Utils.executeGET(httpClient, url, Utils.JSONCONSUMER),
+ false,
+ List.of("metrics", "solr.node:CONTAINER.zkClient"));
+ System.out.println(Utils.toJSONString(zkMmetrics));
Review Comment:
sorry, missed out
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org