Files
kopia/snapshot/stats.go
Jarek Kowalski 54edb97b3a refactoring: renamed repo/block to repo/content
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
2019-06-01 22:24:19 -07:00

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()
}
}