]> source.dussan.org Git - jgit.git/commitdiff
Add toString() for RepoStatistics 86/11186/1
authorEdwin Kempin <edwin.kempin@sap.com>
Fri, 15 Mar 2013 08:39:18 +0000 (09:39 +0100)
committerEdwin Kempin <edwin.kempin@sap.com>
Fri, 15 Mar 2013 08:42:19 +0000 (09:42 +0100)
This is helpful for writing the repository statistics into a log file.

Change-Id: I0e8cd9ad05f123ab3851960890a50213f353a373
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java

index b93ce2bb36a32090a2c3c2d88637d5cf2c9ef893..6fc7b97a30fdab364ce0605e175e555412a2c991 100644 (file)
@@ -824,6 +824,18 @@ public class GC {
                 * The number of refs stored in pack files.
                 */
                public long numberOfPackedRefs;
+
+               public String toString() {
+                       final StringBuilder b = new StringBuilder();
+                       b.append("numberOfPackedObjects=").append(numberOfPackedObjects); //$NON-NLS-1$
+                       b.append(",numberOfPackFiles=").append(numberOfPackFiles); //$NON-NLS-1$
+                       b.append(", numberOfLooseObjects=").append(numberOfLooseObjects); //$NON-NLS-1$
+                       b.append(", numberOfLooseRefs=").append(numberOfLooseRefs); //$NON-NLS-1$
+                       b.append(", numberOfPackedRefs=").append(numberOfPackedRefs); //$NON-NLS-1$
+                       b.append(", sizeOfLooseObjects=").append(sizeOfLooseObjects); //$NON-NLS-1$
+                       b.append(", sizeOfPackedObjects=").append(sizeOfPackedObjects); //$NON-NLS-1$
+                       return b.toString();
+               }
        }
 
        /**