lukecwik commented on a change in pull request #16495:
URL: https://github.com/apache/beam/pull/16495#discussion_r785177482



##########
File path: 
sdks/java/harness/src/test/java/org/apache/beam/fn/harness/CachesTest.java
##########
@@ -160,4 +160,20 @@ private void testCache(Cache<String, String> cache) {
     assertEquals("value2", cache.computeIfAbsent("key2", (unused) -> 
"value2"));
     assertEquals("value2", cache.peek("key2"));
   }
+
+  @Test
+  public void testDescribeStats() throws Exception {
+    Cache<Integer, WeightedValue<String>> cache = Caches.forMaximumBytes(1000 
* 1048576L);
+    for (int i = 0; i < 100; ++i) {
+      cache.computeIfAbsent(i, (key) -> WeightedValue.of("value", 1048576L));
+      cache.peek(i);
+      cache.put(100 + i, WeightedValue.of("value", 1048576L));
+    }
+
+    assertThat(cache.describeStats(), containsString("used/max 200/1000 MB"));

Review comment:
       Added eviction count and checked evictions and shrinkage.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to