MCPcopy
hub / github.com/kopia/kopia / BytesPerSecondsString

Function BytesPerSecondsString

internal/units/units.go:69–72  ·  view source on GitHub ↗

BytesPerSecondsString formats the given value bytes per second with the appropriate base-10 suffix (KB/s, MB/s, GB/s, ...)

(bps T)

Source from the content-addressed store, hash-verified

67
68// BytesPerSecondsString formats the given value bytes per second with the appropriate base-10 suffix (KB/s, MB/s, GB/s, ...)
69func BytesPerSecondsString[T realNumber](bps T) string {
70 //nolint:mnd
71 return toDecimalUnitString(bps, 1000, base10UnitPrefixes, "B/s")
72}
73
74// Count returns the given number with the appropriate base-10 suffix (K, M, G, ...)
75func Count[T constraints.Integer](v T) string {

Callers 3

outputMethod · 0.92
runSyncBlobsMethod · 0.92
setThrottleFloat64Method · 0.92

Calls 1

toDecimalUnitStringFunction · 0.85

Tested by

no test coverage detected