public void verifyReadLockCountStatsForRangeIndex(boolean isPr) throws Exception {
    QueryObserverImpl observer = new QueryObserverImpl();
    QueryObserver old = QueryObserverHolder.setInstance(observer);

    String regionName = "exampleRegion";
    String name = SEPARATOR + regionName;

    final Cache cache = CacheUtils.getCache();
    Region r1 = cache.getRegion(regionName);

    QueryService qs = cache.getQueryService();
    Index secIdIndex = qs.createIndex("secId", "pos.secId", name + " p, p.positions.values pos");
    assertEquals(cache.getQueryService().getIndexes().size(), 1);

    for (int i = 0; i < 10; i++) {
      r1.put("key-" + i, new Portfolio(i));
    }

    String query =
        "select distinct * from " + name + " p, p.positions.values pos where pos.secId = 'IBM' ";

    final Query q = cache.getQueryService().newQuery(query);
    SelectResults sr = (SelectResults) q.execute();

    assertEquals("Read locks should have been taken by the query ", 1, observer.readLockCount);
    assertEquals("Read lock count should have been released by the query ", 0,
        secIdIndex.getStatistics().getReadLockCount());
    assertEquals("Read lock count should have been released by the query ", 0,
        secIdIndex.getStatistics().getReadLockCountLong());

    QueryObserverHolder.setInstance(old);
    qs.removeIndexes();
  }
Test MapRenageIndex IndexStatistics for keys, values, updates and uses.
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexStatisticsJUnitTest.java