use of org.apache.geode.cache.lucene.management.LuceneIndexMetrics in project geode by apache.
the class LuceneServiceBridge method listIndexMetrics.
public LuceneIndexMetrics[] listIndexMetrics() {
Collection<LuceneIndex> indexes = this.service.getAllIndexes();
LuceneIndexMetrics[] indexMetrics = new LuceneIndexMetrics[indexes.size()];
int i = 0;
for (LuceneIndex index : this.service.getAllIndexes()) {
indexMetrics[i++] = getIndexMetrics((LuceneIndexImpl) index);
}
return indexMetrics;
}
use of org.apache.geode.cache.lucene.management.LuceneIndexMetrics in project geode by apache.
the class LuceneManagementDUnitTest method verifyMBeanIndexMetricsValues.
private void verifyMBeanIndexMetricsValues(String regionName, String indexName, int expectedPuts, int expectedQueries, int expectedHits) {
// Get index metrics from all members
Set<DistributedMember> members = GemFireCacheImpl.getInstance().getDistributionManager().getOtherNormalDistributionManagerIds();
int totalCommits = 0, totalUpdates = 0, totalDocuments = 0, totalQueries = 0, totalHits = 0;
for (DistributedMember member : members) {
LuceneServiceMXBean mbean = getMBeanProxy(member);
LuceneIndexMetrics metrics = mbean.listIndexMetrics(regionName, indexName);
assertNotNull(metrics);
totalCommits += metrics.getCommits();
totalUpdates += metrics.getUpdates();
totalDocuments += metrics.getDocuments();
totalQueries += metrics.getQueryExecutions();
totalHits += metrics.getQueryExecutionTotalHits();
}
// Verify index metrics counts
assertEquals(expectedPuts, totalCommits);
assertEquals(expectedPuts, totalUpdates);
assertEquals(expectedPuts, totalDocuments);
assertEquals(expectedQueries, totalQueries);
assertEquals(expectedHits, totalHits);
}
Aggregations