mirror of
https://github.com/restic/restic.git
synced 2025-12-04 03:01:55 +00:00
Merge pull request #4705 from MichaelEischer/snapshot-statistics
Store snapshot statistics & print snapshot size
This commit is contained in:
@@ -25,11 +25,31 @@ type Snapshot struct {
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Original *ID `json:"original,omitempty"`
|
||||
|
||||
ProgramVersion string `json:"program_version,omitempty"`
|
||||
ProgramVersion string `json:"program_version,omitempty"`
|
||||
Summary *SnapshotSummary `json:"summary,omitempty"`
|
||||
|
||||
id *ID // plaintext ID, used during restore
|
||||
}
|
||||
|
||||
type SnapshotSummary struct {
|
||||
BackupStart time.Time `json:"backup_start"`
|
||||
BackupEnd time.Time `json:"backup_end"`
|
||||
|
||||
// statistics from the backup json output
|
||||
FilesNew uint `json:"files_new"`
|
||||
FilesChanged uint `json:"files_changed"`
|
||||
FilesUnmodified uint `json:"files_unmodified"`
|
||||
DirsNew uint `json:"dirs_new"`
|
||||
DirsChanged uint `json:"dirs_changed"`
|
||||
DirsUnmodified uint `json:"dirs_unmodified"`
|
||||
DataBlobs int `json:"data_blobs"`
|
||||
TreeBlobs int `json:"tree_blobs"`
|
||||
DataAdded uint64 `json:"data_added"`
|
||||
DataAddedPacked uint64 `json:"data_added_packed"`
|
||||
TotalFilesProcessed uint `json:"total_files_processed"`
|
||||
TotalBytesProcessed uint64 `json:"total_bytes_processed"`
|
||||
}
|
||||
|
||||
// NewSnapshot returns an initialized snapshot struct for the current user and
|
||||
// time.
|
||||
func NewSnapshot(paths []string, tags []string, hostname string, time time.Time) (*Snapshot, error) {
|
||||
|
||||
Reference in New Issue
Block a user