|
@@ -170,14 +170,75 @@ public class SnapshotDiffReport {
|
|
|
/** end point of the diff */
|
|
|
private final String toSnapshot;
|
|
|
|
|
|
+
|
|
|
/** list of diff */
|
|
|
private final List<DiffReportEntry> diffList;
|
|
|
|
|
|
+ /**
|
|
|
+ * Records the stats related to Snapshot diff operation.
|
|
|
+ */
|
|
|
+ public static class DiffStats {
|
|
|
+ // Total dirs processed
|
|
|
+ private long totalDirsProcessed;
|
|
|
+
|
|
|
+ // Total dirs compared
|
|
|
+ private long totalDirsCompared;
|
|
|
+
|
|
|
+ // Total files processed
|
|
|
+ private long totalFilesProcessed;
|
|
|
+
|
|
|
+ // Total files compared
|
|
|
+ private long totalFilesCompared;
|
|
|
+
|
|
|
+ // Total children listing time
|
|
|
+ private final long totalChildrenListingTime;
|
|
|
+
|
|
|
+ public DiffStats(long totalDirsProcessed, long totalDirsCompared,
|
|
|
+ long totalFilesProcessed, long totalFilesCompared,
|
|
|
+ long totalChildrenListingTime) {
|
|
|
+ this.totalDirsCompared = totalDirsProcessed;
|
|
|
+ this.totalDirsProcessed = totalDirsCompared;
|
|
|
+ this.totalFilesCompared = totalFilesProcessed;
|
|
|
+ this.totalFilesProcessed = totalFilesCompared;
|
|
|
+ this.totalChildrenListingTime = totalChildrenListingTime;
|
|
|
+ }
|
|
|
+
|
|
|
+ public long getTotalDirsProcessed() {
|
|
|
+ return this.totalDirsProcessed;
|
|
|
+ }
|
|
|
+
|
|
|
+ public long getTotalDirsCompared() {
|
|
|
+ return this.totalDirsCompared;
|
|
|
+ }
|
|
|
+
|
|
|
+ public long getTotalFilesProcessed() {
|
|
|
+ return this.totalFilesProcessed;
|
|
|
+ }
|
|
|
+
|
|
|
+ public long getTotalFilesCompared() {
|
|
|
+ return this.totalFilesCompared;
|
|
|
+ }
|
|
|
+
|
|
|
+ public long getTotalChildrenListingTime() {
|
|
|
+ return totalChildrenListingTime;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* Stats associated with the SnapshotDiff Report. */
|
|
|
+ private final DiffStats diffStats;
|
|
|
+
|
|
|
public SnapshotDiffReport(String snapshotRoot, String fromSnapshot,
|
|
|
String toSnapshot, List<DiffReportEntry> entryList) {
|
|
|
+ this(snapshotRoot, fromSnapshot, toSnapshot, new DiffStats(0, 0, 0, 0, 0),
|
|
|
+ entryList);
|
|
|
+ }
|
|
|
+
|
|
|
+ public SnapshotDiffReport(String snapshotRoot, String fromSnapshot,
|
|
|
+ String toSnapshot, DiffStats dStat, List<DiffReportEntry> entryList) {
|
|
|
this.snapshotRoot = snapshotRoot;
|
|
|
this.fromSnapshot = fromSnapshot;
|
|
|
this.toSnapshot = toSnapshot;
|
|
|
+ this.diffStats = dStat;
|
|
|
this.diffList = entryList != null ? entryList : Collections
|
|
|
.<DiffReportEntry> emptyList();
|
|
|
}
|
|
@@ -197,6 +258,10 @@ public class SnapshotDiffReport {
|
|
|
return toSnapshot;
|
|
|
}
|
|
|
|
|
|
+ public DiffStats getStats() {
|
|
|
+ return this.diffStats;
|
|
|
+ }
|
|
|
+
|
|
|
/** @return {@link #diffList} */
|
|
|
public List<DiffReportEntry> getDiffList() {
|
|
|
return diffList;
|