(ctx context.Context, buckets upload.SampleBuckets, prefix string, showExamples bool)
| 58 | } |
| 59 | |
| 60 | func logBucketSamples(ctx context.Context, buckets upload.SampleBuckets, prefix string, showExamples bool) { |
| 61 | hasAny := false |
| 62 | |
| 63 | for i, bucket := range buckets { |
| 64 | if bucket.Count == 0 { |
| 65 | continue |
| 66 | } |
| 67 | |
| 68 | var sizeRange string |
| 69 | |
| 70 | if i == 0 { |
| 71 | sizeRange = fmt.Sprintf("< %-6v", |
| 72 | units.BytesString(bucket.MinSize)) |
| 73 | } else { |
| 74 | sizeRange = fmt.Sprintf("%-6v...%6v", |
| 75 | units.BytesString(bucket.MinSize), |
| 76 | units.BytesString(buckets[i-1].MinSize)) |
| 77 | } |
| 78 | |
| 79 | userLog(ctx).Infof("%v files %v: %7v files, total size %v\n", |
| 80 | prefix, |
| 81 | sizeRange, |
| 82 | bucket.Count, units.BytesString(bucket.TotalSize)) |
| 83 | |
| 84 | hasAny = true |
| 85 | |
| 86 | if showExamples && len(bucket.Examples) > 0 { |
| 87 | userLog(ctx).Info("Examples:") |
| 88 | |
| 89 | for _, sample := range bucket.Examples { |
| 90 | userLog(ctx).Infof(" - %v\n", sample) |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | if !hasAny { |
| 96 | userLog(ctx).Infof("%v files: None", prefix) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | var _ upload.EstimateProgress = estimateTaskProgress{} |
| 101 |
no test coverage detected