[ 
https://issues.apache.org/jira/browse/SOLR-15616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679824#comment-17679824
 ] 

Kevin Risden commented on SOLR-15616:
-------------------------------------


{code:java}
IMPORTANT. This is the first time you ran the build. I wrote some sane defaults 
(for this machine) to 'gradle.properties', they will be picked up on 
consecutive gradle invocations (not this one).

Run gradlew :helpLocalSettings for more information.
{code}


Do you do a clean git checkout everytime? Since gradle.properties is created if 
it doesn't exist everytime with the right defaults to run the full build.

This means that you haven't been running check for any commit.

Your recent commit caused this:


{code:java}
> Task :solr:core:spotlessJavaCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':solr:core:spotlessJavaCheck'.
> The following files had format violations:
      src/java/org/apache/solr/core/MetricsConfig.java
          @@ -244,7 +244,7 @@
           ··public·static·class·CacheConfig·{
           
····public·Integer·threadsIntervalSeconds;·//·intervals·for·which·the·threads·metrics·are·cached

          -····public·CacheConfig·(Integer·threadsIntervalSeconds)·{
          +····public·CacheConfig(Integer·threadsIntervalSeconds)·{
           ······this.threadsIntervalSeconds·=·threadsIntervalSeconds;
           ····}
           ··}
      src/java/org/apache/solr/core/SolrXmlConfig.java
          @@ -659,8 +659,13 @@

           ····ConfigNode·caching·=·metrics.get("solr/metrics/caching");
           ····if·(caching·!=·null)·{
          
-······Object·threadsCachingIntervalSeconds·=·DOMUtil.childNodesToNamedList(caching).get("threadsIntervalSeconds",·null);
          
-······builder.setCacheConfig(new·MetricsConfig.CacheConfig(threadsCachingIntervalSeconds·==·null?·null:·Integer.parseInt(threadsCachingIntervalSeconds.toString())));
          +······Object·threadsCachingIntervalSeconds·=
          
+··········DOMUtil.childNodesToNamedList(caching).get("threadsIntervalSeconds",·null);
          +······builder.setCacheConfig(
          +··········new·MetricsConfig.CacheConfig(
          +··············threadsCachingIntervalSeconds·==·null
          +··················?·null
          
+··················:·Integer.parseInt(threadsCachingIntervalSeconds.toString())));
           ····}

           
····PluginInfo[]·reporterPlugins·=·getMetricReporterPluginInfos(metrics);
      src/java/org/apache/solr/servlet/CoreContainerProvider.java
          @@ -429,13 +429,25 @@
           ······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");
          +······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");
      ... (10 more lines that didn't fit)

  IMPORTANT: run the top-level './gradlew tidy' to format code automatically 
(see help/formatting.txt for more info).
{code}


> Allow thread metrics to be cached
> ---------------------------------
>
>                 Key: SOLR-15616
>                 URL: https://issues.apache.org/jira/browse/SOLR-15616
>             Project: Solr
>          Issue Type: Improvement
>          Components: metrics
>            Reporter: Ishan Chattopadhyaya
>            Assignee: Ishan Chattopadhyaya
>            Priority: Major
>         Attachments: SOLR-15616-2.patch, SOLR-15616-9x.patch, 
> SOLR-15616.patch, SOLR-15616.patch
>
>
> Computing JVM metrics for threads can be expensive, and we should provide 
> option to users to avoid doing so on every call to the metrics API 
> (group=jvm).
> solr.xml:
> {code}
> <solr>
> <metrics enabled=true>
>   <caching>
>     <int name="threadsIntervalSeconds">2</int>
>   </caching>
> ..
> </metrics>
> </solr>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to