aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerry Parker <tparker@google.com>2019-03-06 10:01:16 -0800
committerTerry Parker <tparker@google.com>2019-03-06 10:54:52 -0800
commite48410ae9a26b8bac282e863f0c4969ce1a34fe2 (patch)
tree22c2506120255533abaa47bf2d7c5256f046fa14
parent16f75aa9da53220026603af6f564da271a9cba3f (diff)
downloadjgit-e48410ae9a26b8bac282e863f0c4969ce1a34fe2.tar.gz
jgit-e48410ae9a26b8bac282e863f0c4969ce1a34fe2.zip
Track object inflation time in DfsReaderIoStats
This can help track down poor long tail performance that isn't accounted for in the readIdxMicros or readBlockMicros metrics. Change-Id: I701b9cfcc124f4ddb860d1766a11ea3557e604ce Signed-off-by: Terry Parker <tparker@google.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderIoStats.java12
2 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
index d04709f6c2..1a5553d7a8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
@@ -757,6 +757,7 @@ public class DfsReader extends ObjectReader implements ObjectReuseAsIs {
*/
int inflate(DfsPackFile pack, long position, byte[] dstbuf,
boolean headerOnly) throws IOException, DataFormatException {
+ long start = System.nanoTime();
prepareInflater();
pin(pack, position);
position += block.setInput(position, inf);
@@ -765,6 +766,7 @@ public class DfsReader extends ObjectReader implements ObjectReuseAsIs {
dstoff += n;
if (inf.finished() || (headerOnly && dstoff == dstbuf.length)) {
stats.inflatedBytes += dstoff;
+ stats.inflationMicros += BlockBasedFile.elapsedMicros(start);
return dstoff;
} else if (inf.needsInput()) {
pin(pack, position);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderIoStats.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderIoStats.java
index c35801f3b0..d6401a1640 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderIoStats.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderIoStats.java
@@ -85,6 +85,9 @@ public class DfsReaderIoStats {
/** Total number of bytes decompressed. */
long inflatedBytes;
+ /** Total microseconds spent inflating compressed bytes. */
+ long inflationMicros;
+
Accumulator() {
}
}
@@ -186,4 +189,13 @@ public class DfsReaderIoStats {
public long getInflatedBytes() {
return stats.inflatedBytes;
}
+
+ /**
+ * Get total microseconds spent inflating compressed bytes.
+ *
+ * @return total microseconds inflating compressed bytes.
+ */
+ public long getInflationMicros() {
+ return stats.inflationMicros;
+ }
}