Codebase list golang-github-vbauerster-mpb / 9922a01
unitFormat example Vladimir Bauer 8 years ago
1 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
132132 // as it will be closed automatically on bar completion event.
133133 //
134134 // `wcc` optional WC config
135 //
136 // unitFormat example if UnitKiB choosen:
137 //
138 // "%.1f" = "1.0MiB/s" or "% .1f" = "1.0 MiB/s"
135139 func EwmaSpeed(unit int, unitFormat string, age float64, sb chan time.Time, wcc ...WC) Decorator {
136140 return MovingAverageSpeed(unit, unitFormat, ewma.NewMovingAverage(age), sb, wcc...)
137141 }
236240 // `unitFormat` printf compatible verb for value, like "%f" or "%d"
237241 //
238242 // `wcc` optional WC config
243 //
244 // unitFormat example if UnitKiB choosen:
245 //
246 // "%.1f" = "1.0MiB/s" or "% .1f" = "1.0 MiB/s"
239247 func AverageSpeed(unit int, unitFormat string, wcc ...WC) Decorator {
240248 var wc WC
241249 for _, widthConf := range wcc {