mhansonp commented on a change in pull request #6430:
URL: https://github.com/apache/geode/pull/6430#discussion_r645039862



##########
File path: 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearDUnitTest.java
##########
@@ -430,13 +423,54 @@ public void normalClearFromClient() {
         .isEqualTo(0);
   }
 
+  @Test
+  public void testClearTime() {
+    configureServers(false, true);
+    client1.invoke(this::initClientCache);
+    client2.invoke(this::initClientCache);
+
+    accessor.invoke(() -> feed(false));
+    verifyServerRegionSize(NUM_ENTRIES);
+    dataStore1.invoke(() -> {
+      PartitionedRegion partitionedRegion = (PartitionedRegion) 
getRegion(false);
+      
assertThat(partitionedRegion.getCachePerfStats().getClearTime()).isEqualTo(0L);
+    });
+    dataStore1.invoke(() -> getRegion(false).clear());
+    verifyServerRegionSize(0);
+    dataStore1.invoke(() -> {
+      PartitionedRegion partitionedRegion = (PartitionedRegion) 
getRegion(false);
+      
assertThat(partitionedRegion.getCachePerfStats().getClearTime()).isGreaterThan(0L);
+    });
+  }
+
+  @Test
+  public void testClearCount() {
+    configureServers(false, true);
+    client1.invoke(this::initClientCache);
+    client2.invoke(this::initClientCache);
+
+    accessor.invoke(() -> feed(false));
+    verifyServerRegionSize(NUM_ENTRIES);
+    dataStore1.invoke(() -> {
+      PartitionedRegion partitionedRegion = (PartitionedRegion) 
getRegion(false);
+      
assertThat(partitionedRegion.getCachePerfStats().getClearCount()).isEqualTo(0L);
+    });
+    dataStore1.invoke(() -> getRegion(false).clear());
+    verifyServerRegionSize(0);
+    dataStore1.invoke(() -> {
+      PartitionedRegion partitionedRegion = (PartitionedRegion) 
getRegion(false);
+      
assertThat(partitionedRegion.getCachePerfStats().getClearCount()).isEqualTo(1L);
+    });
+  }

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to