PackWriter/Statistics: Report offloaded size
Add to statistics the amount and size of packfiles offloaded to HTTP download. Change-Id: I895a7219ecac2794368bfc4fdfae74c1238deed9 Signed-off-by: Ivan Frade <ifrade@google.com>
This commit is contained in:
parent
892c804699
commit
a307c88714
|
@ -1230,6 +1230,8 @@ public void writePack(ProgressMonitor compressMonitor,
|
||||||
if (packInfo != null) {
|
if (packInfo != null) {
|
||||||
o.writeString(packInfo.getHash() + ' ' +
|
o.writeString(packInfo.getHash() + ' ' +
|
||||||
packInfo.getUri() + '\n');
|
packInfo.getUri() + '\n');
|
||||||
|
stats.offloadedPackfiles += 1;
|
||||||
|
stats.offloadedPackfileSize += packInfo.getSize();
|
||||||
} else {
|
} else {
|
||||||
unwrittenCachedPacks.add(pack);
|
unwrittenCachedPacks.add(pack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,6 +270,20 @@ public static class Accumulator {
|
||||||
* @since 5.4*/
|
* @since 5.4*/
|
||||||
public long treesTraversed;
|
public long treesTraversed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of packfile uris sent to the client to download via HTTP.
|
||||||
|
*
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public long offloadedPackfiles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total size (in bytes) offloaded to HTTP downloads.
|
||||||
|
*
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public long offloadedPackfileSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Statistics about each object type in the pack (commits, tags, trees
|
* Statistics about each object type in the pack (commits, tags, trees
|
||||||
* and blobs.)
|
* and blobs.)
|
||||||
|
@ -597,6 +611,22 @@ public long getTreesTraversed() {
|
||||||
return statistics.treesTraversed;
|
return statistics.treesTraversed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return amount of packfiles offloaded (sent as "packfile-uri")/
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public long getOffloadedPackfiles() {
|
||||||
|
return statistics.offloadedPackfiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return total size (in bytes) offloaded to HTTP downloads.
|
||||||
|
* @since 5.6
|
||||||
|
*/
|
||||||
|
public long getOffloadedPackfilesSize() {
|
||||||
|
return statistics.offloadedPackfileSize;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get total time spent processing this pack.
|
* Get total time spent processing this pack.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue