Convenience functions CountersKibiByte and CountersKiloByte
Vladimir Bauer
8 years ago
| 89 | 89 | return Counters(pairFormat, 0, minWidth, conf) |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | // CountersKibiByte returns human friendly byte counters decorator, where | |
| 93 | // counters unit is multiple by 1024. | |
| 94 | func CountersKibiByte(pairFormat string, minWidth int, conf byte) DecoratorFunc { | |
| 95 | return Counters(pairFormat, Unit_KiB, minWidth, conf) | |
| 96 | } | |
| 97 | ||
| 98 | // CountersKiloByte returns human friendly byte counters decorator, where | |
| 99 | // counters unit is multiple by 1000. | |
| 100 | func CountersKiloByte(pairFormat string, minWidth int, conf byte) DecoratorFunc { | |
| 101 | return Counters(pairFormat, Unit_kB, minWidth, conf) | |
| 102 | } | |
| 103 | ||
| 92 | 104 | // Counters provides basic counters decorator. |
| 93 | 105 | // pairFormat must contain two printf compatible verbs, like "%f" or "%d". |
| 94 | 106 | // First verb substituted with Current, second one with Total. For example (assuming decor.Unit_KiB used): |