mirror of https://github.com/apache/lucene.git
SOLR-9374: Speed up Jmx MBean retrieval for FieldCache
This commit is contained in:
parent
4f316bc199
commit
b1b933eb43
|
@ -92,6 +92,8 @@ Bug Fixes
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
* SOLR-9374: Speed up Jmx MBean retrieval for FieldCache. (Tim Owen via shalin)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -61,12 +61,14 @@ public class SolrFieldCacheMBean implements JmxAugmentedSolrInfoMBean {
|
||||||
|
|
||||||
private NamedList getStats(boolean listEntries) {
|
private NamedList getStats(boolean listEntries) {
|
||||||
NamedList stats = new SimpleOrderedMap();
|
NamedList stats = new SimpleOrderedMap();
|
||||||
|
if (listEntries) {
|
||||||
String[] entries = UninvertingReader.getUninvertedStats();
|
String[] entries = UninvertingReader.getUninvertedStats();
|
||||||
stats.add("entries_count", entries.length);
|
stats.add("entries_count", entries.length);
|
||||||
if (listEntries) {
|
|
||||||
for (int i = 0; i < entries.length; i++) {
|
for (int i = 0; i < entries.length; i++) {
|
||||||
stats.add("entry#" + i, entries[i]);
|
stats.add("entry#" + i, entries[i]);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
stats.add("entries_count", UninvertingReader.getUninvertedStatsSize());
|
||||||
}
|
}
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,4 +388,8 @@ public class UninvertingReader extends FilterLeafReader {
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getUninvertedStatsSize() {
|
||||||
|
return FieldCache.DEFAULT.getCacheEntries().length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue