]> source.dussan.org Git - jgit.git/commitdiff
DfsReaderIoStats: Add Commit Graph fields into DfsReaderIoStats 46/199546/4
authorXing Huang <xingkhuang@google.com>
Tue, 24 Jan 2023 19:17:40 +0000 (13:17 -0600)
committerXing Huang <xingkhuang@google.com>
Wed, 25 Jan 2023 21:29:04 +0000 (15:29 -0600)
We are adding commit-graph loading to the DFS stack and the stats object doesn't have fields to track that.

This change replicates the stats of the primary index for the commit-graph.

Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: I4a657bed50083c4ae8bc9f059d4943d612ea2d49

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderIoStats.java

index 5c4742501310fa861fcd5b8ec387cd10c449f633..5ac7985e97ed473a12a2c45dff1d259e047397a4 100644 (file)
@@ -28,6 +28,9 @@ public class DfsReaderIoStats {
                /** Total number of cache hits for bitmap indexes. */
                long bitmapCacheHit;
 
+               /** Total number of cache hits for commit graphs. */
+               long commitGraphCacheHit;
+
                /** Total number of complete pack indexes read into memory. */
                long readIdx;
 
@@ -37,15 +40,24 @@ public class DfsReaderIoStats {
                /** Total number of reverse indexes added into memory. */
                long readReverseIdx;
 
+               /** Total number of complete commit graphs read into memory. */
+               long readCommitGraph;
+
                /** Total number of bytes read from pack indexes. */
                long readIdxBytes;
 
+               /** Total number of bytes read from commit graphs. */
+               long readCommitGraphBytes;
+
                /** Total microseconds spent reading pack indexes. */
                long readIdxMicros;
 
                /** Total microseconds spent creating reverse indexes. */
                long readReverseIdxMicros;
 
+               /** Total microseconds spent creating commit graphs. */
+               long readCommitGraphMicros;
+
                /** Total number of bytes read from bitmap indexes. */
                long readBitmapIdxBytes;
 
@@ -122,6 +134,15 @@ public class DfsReaderIoStats {
                return stats.bitmapCacheHit;
        }
 
+       /**
+        * Get total number of commit graph cache hits.
+        *
+        * @return total number of commit graph cache hits.
+        */
+       public long getCommitGraphCacheHits() {
+               return stats.commitGraphCacheHit;
+       }
+
        /**
         * Get total number of complete pack indexes read into memory.
         *
@@ -140,6 +161,15 @@ public class DfsReaderIoStats {
                return stats.readReverseIdx;
        }
 
+       /**
+        * Get total number of times the commit graph read into memory.
+        *
+        * @return total number of commit graph read into memory.
+        */
+       public long getReadCommitGraphCount() {
+               return stats.readCommitGraph;
+       }
+
        /**
         * Get total number of complete bitmap indexes read into memory.
         *
@@ -158,6 +188,15 @@ public class DfsReaderIoStats {
                return stats.readIdxBytes;
        }
 
+       /**
+        * Get total number of bytes read from commit graphs.
+        *
+        * @return total number of bytes read from commit graphs.
+        */
+       public long getCommitGraphBytes() {
+               return stats.readCommitGraphBytes;
+       }
+
        /**
         * Get total microseconds spent reading pack indexes.
         *
@@ -176,6 +215,15 @@ public class DfsReaderIoStats {
                return stats.readReverseIdxMicros;
        }
 
+       /**
+        * Get total microseconds spent reading commit graphs.
+        *
+        * @return total microseconds spent reading commit graphs.
+        */
+       public long getReadCommitGraphMicros() {
+               return stats.readCommitGraphMicros;
+       }
+
        /**
         * Get total number of bytes read from bitmap indexes.
         *