dsmiley commented on code in PR #3494:
URL: https://github.com/apache/solr/pull/3494#discussion_r2291664981
##########
solr/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterIntegrationTest.java:
##########
@@ -61,16 +61,6 @@ public void solrExporterDurationMetric() throws Exception {
assertEquals(18, durationHistogram.size());
}
- @Test
- public void jvmMetrics() throws Exception {
Review Comment:
oh; I thought the whole prometheus exporter was already removed
##########
solr/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterIntegrationTest.java:
##########
@@ -61,16 +61,6 @@ public void solrExporterDurationMetric() throws Exception {
assertEquals(18, durationHistogram.size());
}
- @Test
- public void jvmMetrics() throws Exception {
Review Comment:
why remove this?
##########
solr/core/src/java/org/apache/solr/servlet/CoreContainerProvider.java:
##########
@@ -407,64 +399,11 @@ protected CoreContainer createCoreContainer(Path
solrHome, Properties nodeProps)
return coreContainer;
}
- private void setupJvmMetrics(CoreContainer coresInit, MetricsConfig config) {
- metricManager = coresInit.getMetricManager();
- registryName = SolrMetricManager.getRegistryName(Group.jvm);
- final NodeConfig nodeConfig = coresInit.getConfig();
- try {
- metricManager.registerAll(
- registryName, new AltBufferPoolMetricSet(),
ResolutionStrategy.IGNORE, "buffers");
- metricManager.registerAll(
- registryName, new ClassLoadingGaugeSet(), ResolutionStrategy.IGNORE,
"classes");
- metricManager.registerAll(
- registryName, new OperatingSystemMetricSet(),
ResolutionStrategy.IGNORE, "os");
- metricManager.registerAll(
- registryName, new GarbageCollectorMetricSet(),
ResolutionStrategy.IGNORE, "gc");
- metricManager.registerAll(
- registryName, new MemoryUsageGaugeSet(), ResolutionStrategy.IGNORE,
"memory");
-
- if (config.getCacheConfig() != null
- && config.getCacheConfig().threadsIntervalSeconds != null) {
- if (log.isInfoEnabled()) {
- log.info(
- "Threads metrics will be cached for {} seconds",
- config.getCacheConfig().threadsIntervalSeconds);
- }
- metricManager.registerAll(
- registryName,
- new CachedThreadStatesGaugeSet(
- config.getCacheConfig().threadsIntervalSeconds,
TimeUnit.SECONDS),
- SolrMetricManager.ResolutionStrategy.IGNORE,
- "threads");
- } else {
- metricManager.registerAll(
- registryName,
- new ThreadStatesGaugeSet(),
- SolrMetricManager.ResolutionStrategy.IGNORE,
- "threads");
- }
-
- MetricsMap sysprops =
- new MetricsMap(
- map ->
- System.getProperties()
- .forEach(
- (k, v) -> {
- if
(!nodeConfig.isSysPropHidden(String.valueOf(k))) {
- map.putNoEx(String.valueOf(k), v);
- }
- }));
- metricManager.registerGauge(
- null,
- registryName,
- sysprops,
- metricTag,
- ResolutionStrategy.IGNORE,
- "properties",
- "system");
- } catch (Exception e) {
- log.warn("Error registering JVM metrics", e);
- }
+ private void setupJvmMetrics(CoreContainer coresInit) {
+ this.metricManager = coresInit.getMetricManager();
+ this.registryName = SolrMetricManager.getRegistryName(Group.jvm);
Review Comment:
why create a field on CoreContainerProvider for this JVM registryName?
--
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]