[ https://issues.apache.org/jira/browse/SOLR-15301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17423400#comment-17423400 ]
David Smiley commented on SOLR-15301: ------------------------------------- The deadline could be defined as twice the time it takes to calculate the index size, with some pre-defined minimum (a second). This also helps performance if somehow many metrics requests are hitting Solr simultaneously (granted should be avoided in the first place). RE the possibility of differing values: That would both be very unlikely but moreover I think very inconsequential. If it's scraped by a bot then the bot is going to look at just one (and really ought not to be asking for others in the first place). If a person... shrug; maybe document this? If you really want a ThreadLocal / request based solution then I think this TL based design could be improved. What I don't like here especially is the loop over the cores to call this cache invalidation method. Instead, consider that Solr _already_ manages a special ThreadLocal: SolrRequestInfo. By "manage", I mean creation/cleanup state so that you don't have to. Thus computing the index size could look for a cached value on the SolrRequestInfo's SolrQueryRequest getContext which is a general purpose map of context information. > Eliminate repetitive index size calculation for Solr metrics > ------------------------------------------------------------ > > Key: SOLR-15301 > URL: https://issues.apache.org/jira/browse/SOLR-15301 > Project: Solr > Issue Type: Improvement > Components: metrics > Reporter: Andras Salamon > Assignee: Andras Salamon > Priority: Minor > Fix For: main (9.0) > > Time Spent: 0.5h > Remaining Estimate: 0h > > During metrics calculation Solr asks for core indexSize three times. Twice in > SolrCore and once in ReplicationHandler. It slows down metrics calculation > and it is also possible that these three reported values are not exactly the > same if size changes during calculation. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org