summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluciole <luciole@systemli.org>2022-11-10 15:12:46 +0100
committerluciole <luciole@systemli.org>2022-11-10 15:12:46 +0100
commit3185487aea4efcdfd70812222b1bd005e270242b (patch)
treed00275166997df848b46edd8ac93ee538c850596
parentac8562803ab9621d037bd1b3710c59799c7aa6d5 (diff)
downloadsnowflake-3185487aea4efcdfd70812222b1bd005e270242b.tar.gz
snowflake-3185487aea4efcdfd70812222b1bd005e270242b.zip
update formatTraffic so that bandwidth unit is always KB
-rw-r--r--proxy/lib/util.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/proxy/lib/util.go b/proxy/lib/util.go
index c7b3684..c444bb0 100644
--- a/proxy/lib/util.go
+++ b/proxy/lib/util.go
@@ -84,16 +84,4 @@ func (b *bytesSyncLogger) ThroughputSummary() string {
func (b *bytesSyncLogger) GetStat() (in int, out int) { return b.inbound, b.outbound }
-func formatTraffic(amount int) (value int, unit string) {
- value = amount
- units := []string{"B", "KB", "MB", "GB"}
- for i, u := range units {
- unit = u
- if (value < 1000) || (i == len(units)-1) {
- break
- }
- value = value / 1000
- }
- return
-
-}
+func formatTraffic(amount int) (value int, unit string) { return amount / 1000, "KB" }