diff options
author | Anna Papitto <annapapitto@google.com> | 2022-11-10 14:49:27 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2022-11-17 12:38:48 -0500 |
commit | bd515f1c2ac1959730bba805dcdc187d74a542fe (patch) | |
tree | c97b3dcb7661be6d9c307ca6e4413853319c98be /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | accacc27a1b282c55e5ee92e69566a9edd1a4bb9 (diff) | |
download | jgit-bd515f1c2ac1959730bba805dcdc187d74a542fe.tar.gz jgit-bd515f1c2ac1959730bba805dcdc187d74a542fe.zip |
DfsBlockCache: Report IndexEventConsumer metrics for reverse indexes.
IndexEventConsumer metrics are reported per index PackExt and reverse
indexes did not have one, so they were not included.
Now that there is a REVERSE_INDEX PackExt, enable reporting
IndexEventConsumer metrics for reverse indexes.
Change-Id: Ia6a752f6eb8932a5b4ba45cc15cbc7e0786fd247
Signed-off-by: Anna Papitto <annapapitto@google.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java index b30d50921a..0a02180d7d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java @@ -712,7 +712,7 @@ public final class DfsBlockCache { private void reportIndexRequested(Ref<?> ref, boolean cacheHit, long start) { if (indexEventConsumer == null - || !isIndexOrBitmapExtPos(ref.key.packExtPos)) { + || !isIndexExtPos(ref.key.packExtPos)) { return; } EvictKey evictKey = new EvictKey(ref); @@ -728,7 +728,7 @@ public final class DfsBlockCache { private void reportIndexEvicted(Ref<?> dead) { if (indexEventConsumer == null || !indexEventConsumer.shouldReportEvictedEvent() - || !isIndexOrBitmapExtPos(dead.key.packExtPos)) { + || !isIndexExtPos(dead.key.packExtPos)) { return; } EvictKey evictKey = new EvictKey(dead); @@ -742,8 +742,9 @@ public final class DfsBlockCache { Duration.ofNanos(sinceLastEvictionNanos)); } - private static boolean isIndexOrBitmapExtPos(int packExtPos) { + private static boolean isIndexExtPos(int packExtPos) { return packExtPos == PackExt.INDEX.getPosition() + || packExtPos == PackExt.REVERSE_INDEX.getPosition() || packExtPos == PackExt.BITMAP_INDEX.getPosition(); } |