MCPcopy
hub / github.com/git-lfs/git-lfs / str

Method str

tq/meter.go:235–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

233}
234
235func (m *Meter) str() string {
236 // (Uploading|Downloading) LFS objects: 100% (10/10) 100 MiB | 10 MiB/s
237 percentage := 100 * float64(m.finishedFiles) / float64(m.estimatedFiles)
238
239 return fmt.Sprintf("%s: %3.f%% (%d/%d), %s | %s",
240 m.Direction.Progress(),
241 percentage,
242 m.finishedFiles, m.estimatedFiles,
243 humanize.FormatBytes(clamp(m.currentBytes)),
244 humanize.FormatByteRate(clampf(m.avgBytes), time.Second))
245}
246
247// clamp clamps the given "x" within the acceptable domain of the uint64 integer
248// type, so as to prevent over- and underflow.

Callers 1

updateMethod · 0.95

Calls 5

FormatBytesFunction · 0.92
FormatByteRateFunction · 0.92
clampFunction · 0.85
clampfFunction · 0.85
ProgressMethod · 0.80

Tested by

no test coverage detected