mirror of
https://github.com/kopia/kopia.git
synced 2026-03-18 22:26:26 -04:00
Also introduced strongly typed content.ID and manifest.ID (instead of string) This aligns identifiers across all layers of repository: blob.ID content.ID object.ID manifest.ID
35 lines
892 B
Go
35 lines
892 B
Go
package snapshot
|
|
|
|
import (
|
|
"github.com/kopia/kopia/fs"
|
|
"github.com/kopia/kopia/repo/content"
|
|
)
|
|
|
|
// Stats keeps track of snapshot generation statistics.
|
|
type Stats struct {
|
|
Content content.Stats `json:"content,omitempty"`
|
|
|
|
TotalDirectoryCount int `json:"dirCount"`
|
|
TotalFileCount int `json:"fileCount"`
|
|
TotalFileSize int64 `json:"totalSize"`
|
|
|
|
ExcludedFileCount int `json:"excludedFileCount"`
|
|
ExcludedTotalFileSize int64 `json:"excludedTotalSize"`
|
|
ExcludedDirCount int `json:"excludedDirCount"`
|
|
|
|
CachedFiles int `json:"cachedFiles"`
|
|
NonCachedFiles int `json:"nonCachedFiles"`
|
|
|
|
ReadErrors int `json:"readErrors"`
|
|
}
|
|
|
|
// AddExcluded adds the information about excluded file to the statistics.
|
|
func (s *Stats) AddExcluded(md fs.Entry) {
|
|
if md.IsDir() {
|
|
s.ExcludedDirCount++
|
|
} else {
|
|
s.ExcludedFileCount++
|
|
s.ExcludedTotalFileSize += md.Size()
|
|
}
|
|
}
|