Search in sources :

Example 1 with LuceneServiceMXBean

use of org.apache.geode.cache.lucene.management.LuceneServiceMXBean in project geode by apache.

the class LuceneManagementDUnitTest method verifyAllMBeanProxyIndexMetrics.

private static void verifyAllMBeanProxyIndexMetrics(String regionName, int numRegionIndexes, int numTotalIndexes) {
    Set<DistributedMember> members = GemFireCacheImpl.getInstance().getDistributionManager().getOtherNormalDistributionManagerIds();
    for (DistributedMember member : members) {
        LuceneServiceMXBean mbean = getMBeanProxy(member);
        verifyMBeanIndexMetrics(mbean, regionName, numRegionIndexes, numTotalIndexes);
    }
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) LuceneServiceMXBean(org.apache.geode.cache.lucene.management.LuceneServiceMXBean)

Example 2 with LuceneServiceMXBean

use of org.apache.geode.cache.lucene.management.LuceneServiceMXBean in project geode by apache.

the class LuceneManagementDUnitTest method getMBean.

private LuceneServiceMXBean getMBean() {
    ObjectName objectName = MBeanJMXAdapter.getCacheServiceMBeanName(getSystem().getDistributedMember(), "LuceneService");
    assertNotNull(getManagementService().getMBeanInstance(objectName, LuceneServiceMXBean.class));
    return getManagementService().getMBeanInstance(objectName, LuceneServiceMXBean.class);
}
Also used : LuceneServiceMXBean(org.apache.geode.cache.lucene.management.LuceneServiceMXBean) ObjectName(javax.management.ObjectName)

Example 3 with LuceneServiceMXBean

use of org.apache.geode.cache.lucene.management.LuceneServiceMXBean 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)

Example 4 with LuceneServiceMXBean

use of org.apache.geode.cache.lucene.management.LuceneServiceMXBean in project geode by apache.

the class LuceneManagementDUnitTest method verifyAllMBeanIndexMetrics.

private void verifyAllMBeanIndexMetrics(String regionName, int numRegionIndexes, int numTotalIndexes) {
    LuceneServiceMXBean mbean = getMBean();
    verifyMBeanIndexMetrics(mbean, regionName, numRegionIndexes, numTotalIndexes);
}
Also used : LuceneServiceMXBean(org.apache.geode.cache.lucene.management.LuceneServiceMXBean)

Aggregations

LuceneServiceMXBean (org.apache.geode.cache.lucene.management.LuceneServiceMXBean)4 DistributedMember (org.apache.geode.distributed.DistributedMember)2 ObjectName (javax.management.ObjectName)1 LuceneIndexMetrics (org.apache.geode.cache.lucene.management.LuceneIndexMetrics)1