SOLR-1292: followup tweak based on mailing list discussion: for indexes with lots of segments, estimating the size of all the field caches can take a lot of time (particularly with lots of String based caches) so for now we only estimate the size for items which are part of instanity instances

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@826788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2009-10-19 19:44:41 +00:00
parent ed436c5cd4
commit b1e21e7041

View File

@ -61,7 +61,6 @@ public class SolrFieldCacheMBean implements SolrInfoMBean {
stats.add("entries_count", entries.length);
for (int i = 0; i < entries.length; i++) {
CacheEntry e = entries[i];
e.estimateSize();
stats.add("entry#" + i, e.toString());
}
@ -69,6 +68,13 @@ public class SolrFieldCacheMBean implements SolrInfoMBean {
stats.add("insanity_count", insanity.length);
for (int i = 0; i < insanity.length; i++) {
// we only estimate the size of insane entries
for (CacheEntry e : insanity[i].getCacheEntries()) {
// don't re-estimate if we've already done it.
if (null == e.getEstimatedSize()) e.estimateSize();
}
stats.add("insanity#" + i, insanity[i].toString());
}
return stats;