unitFormat example
Vladimir Bauer
8 years ago
| 132 | 132 | // as it will be closed automatically on bar completion event. |
| 133 | 133 | // |
| 134 | 134 | // `wcc` optional WC config |
| 135 | // | |
| 136 | // unitFormat example if UnitKiB choosen: | |
| 137 | // | |
| 138 | // "%.1f" = "1.0MiB/s" or "% .1f" = "1.0 MiB/s" | |
| 135 | 139 | func EwmaSpeed(unit int, unitFormat string, age float64, sb chan time.Time, wcc ...WC) Decorator { |
| 136 | 140 | return MovingAverageSpeed(unit, unitFormat, ewma.NewMovingAverage(age), sb, wcc...) |
| 137 | 141 | } |
| 236 | 240 | // `unitFormat` printf compatible verb for value, like "%f" or "%d" |
| 237 | 241 | // |
| 238 | 242 | // `wcc` optional WC config |
| 243 | // | |
| 244 | // unitFormat example if UnitKiB choosen: | |
| 245 | // | |
| 246 | // "%.1f" = "1.0MiB/s" or "% .1f" = "1.0 MiB/s" | |
| 239 | 247 | func AverageSpeed(unit int, unitFormat string, wcc ...WC) Decorator { |
| 240 | 248 | var wc WC |
| 241 | 249 | for _, widthConf := range wcc { |