MCPcopy
hub / github.com/kopia/kopia / Stats

Method Stats

internal/server/api_estimate.go:39–58  ·  view source on GitHub ↗
(ctx context.Context, st *snapshot.Stats, included, excluded upload.SampleBuckets, excludedDirs []string, final bool)

Source from the content-addressed store, hash-verified

37}
38
39func (p estimateTaskProgress) Stats(ctx context.Context, st *snapshot.Stats, included, excluded upload.SampleBuckets, excludedDirs []string, final bool) {
40 _ = excludedDirs
41 _ = final
42
43 p.ctrl.ReportCounters(map[string]uitask.CounterValue{
44 "Bytes": uitask.BytesCounter(atomic.LoadInt64(&st.TotalFileSize)),
45 "Excluded Bytes": uitask.BytesCounter(atomic.LoadInt64(&st.ExcludedTotalFileSize)),
46 "Files": uitask.SimpleCounter(int64(atomic.LoadInt32(&st.TotalFileCount))),
47 "Directories": uitask.SimpleCounter(int64(atomic.LoadInt32(&st.TotalDirectoryCount))),
48 "Excluded Files": uitask.SimpleCounter(int64(atomic.LoadInt32(&st.ExcludedFileCount))),
49 "Excluded Directories": uitask.SimpleCounter(int64(atomic.LoadInt32(&st.ExcludedDirCount))),
50 "Errors": uitask.ErrorCounter(int64(atomic.LoadInt32(&st.ErrorCount))),
51 "Ignored Errors": uitask.ErrorCounter(int64(atomic.LoadInt32(&st.IgnoredErrorCount))),
52 })
53
54 if final {
55 logBucketSamples(ctx, included, "Included", false)
56 logBucketSamples(ctx, excluded, "Excluded", true)
57 }
58}
59
60func logBucketSamples(ctx context.Context, buckets upload.SampleBuckets, prefix string, showExamples bool) {
61 hasAny := false

Callers

nothing calls this directly

Calls 5

BytesCounterFunction · 0.92
SimpleCounterFunction · 0.92
ErrorCounterFunction · 0.92
logBucketSamplesFunction · 0.85
ReportCountersMethod · 0.65

Tested by

no test coverage detected