Search in sources :

Example 1 with LuceneIndexMetrics

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;
}
Also used : LuceneIndex(org.apache.geode.cache.lucene.LuceneIndex) LuceneIndexMetrics(org.apache.geode.cache.lucene.management.LuceneIndexMetrics) LuceneIndexImpl(org.apache.geode.cache.lucene.internal.LuceneIndexImpl)

Example 2 with LuceneIndexMetrics

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);
}
Also used : LuceneIndexMetrics(org.apache.geode.cache.lucene.management.LuceneIndexMetrics) DistributedMember(org.apache.geode.distributed.DistributedMember) LuceneServiceMXBean(org.apache.geode.cache.lucene.management.LuceneServiceMXBean)

Aggregations

LuceneIndexMetrics (org.apache.geode.cache.lucene.management.LuceneIndexMetrics)2 LuceneIndex (org.apache.geode.cache.lucene.LuceneIndex)1 LuceneIndexImpl (org.apache.geode.cache.lucene.internal.LuceneIndexImpl)1 LuceneServiceMXBean (org.apache.geode.cache.lucene.management.LuceneServiceMXBean)1 DistributedMember (org.apache.geode.distributed.DistributedMember)1