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>
*/
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);
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);
/** Total number of bytes decompressed. */
long inflatedBytes;
+ /** Total microseconds spent inflating compressed bytes. */
+ long inflationMicros;
+
Accumulator() {
}
}
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;
+ }
}