Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2190

Add test to differentiate between TOTAL_NR_OF_ENTRIES and CURRENT_NR_OF_ENTRIES statistics

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 5.2.0.Final
    • None
    • Remote Protocols
    • None

      After cache.clear() is invoked, the server should return 0 as ServerStatistics.TOTAL_NR_OF_ENTRIES. It actually returns the previous value before clear.

      I think its a serve (vs client) issue as it is reproductible on both java and c# clients.

      Here's a unit test to be added to HotRodStatisticsTest in order to reproduce the issue:

       public void testNumberOfEntriesAfterClear() {
            assertEquals((Integer)0, remoteCache.stats().getIntStatistic(ServerStatistics.TOTAL_NR_OF_ENTRIES));
            remoteCache.put("k", "v");
            remoteCache.put("k2", "v");
            assertEquals((Integer)2, remoteCache.stats().getIntStatistic(ServerStatistics.TOTAL_NR_OF_ENTRIES));
            remoteCache.clear();
            assertEquals((Integer)0, remoteCache.stats().getIntStatistic(ServerStatistics.TOTAL_NR_OF_ENTRIES));
         }
      
      

              rh-ee-galder Galder ZamarreƱo
              mircea.markus Mircea Markus (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: