From 159da6dacc6b60fde77cf10e82312a277c787a3f Mon Sep 17 00:00:00 2001 From: Minh Thai Date: Mon, 27 Nov 2017 14:28:11 -0800 Subject: Break down DfsBlockCache stats by pack file extension. Change-Id: Iaecf0580279b33e3e2439784528cae7b69fb28bc Signed-off-by: Minh Thai --- .../eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java | 2 +- .../org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java index 32d711f1f8..6a5d3c2347 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java @@ -64,7 +64,7 @@ public class DeltaBaseCacheTest { @Before public void setUp() { DfsRepositoryDescription repo = new DfsRepositoryDescription("test"); - key = DfsStreamKey.of(repo, "test.key"); + key = DfsStreamKey.of(repo, "test.key", null); cache = new DeltaBaseCache(SZ); rng = new TestRng(getClass().getSimpleName()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java index 2e3ee4526f..d29744dfc5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java @@ -50,6 +50,7 @@ import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.stream.LongStream; import org.eclipse.jgit.junit.TestRng; import org.eclipse.jgit.lib.ObjectId; @@ -84,9 +85,9 @@ public class DfsBlockCacheTest { ins.flush(); } - long oldSize = cache.getCurrentSize(); + long oldSize = LongStream.of(cache.getCurrentSize()).sum(); assertTrue(oldSize > 2000); - assertEquals(0, cache.getHitCount()); + assertEquals(0, LongStream.of(cache.getHitCount()).sum()); List packs = r1.getObjectDatabase().listPacks(); InMemoryRepository r2 = new InMemoryRepository(repo); @@ -95,8 +96,8 @@ public class DfsBlockCacheTest { byte[] actual = rdr.open(id, OBJ_BLOB).getBytes(); assertTrue(Arrays.equals(content, actual)); } - assertEquals(0, cache.getMissCount()); - assertEquals(oldSize, cache.getCurrentSize()); + assertEquals(0, LongStream.of(cache.getMissCount()).sum()); + assertEquals(oldSize, LongStream.of(cache.getCurrentSize()).sum()); } @SuppressWarnings("resource") -- cgit v1.2.3