diff options
author | luciole <luciole@systemli.org> | 2022-11-10 15:12:46 +0100 |
---|---|---|
committer | luciole <luciole@systemli.org> | 2022-11-10 15:12:46 +0100 |
commit | 3185487aea4efcdfd70812222b1bd005e270242b (patch) | |
tree | d00275166997df848b46edd8ac93ee538c850596 | |
parent | ac8562803ab9621d037bd1b3710c59799c7aa6d5 (diff) | |
download | snowflake-3185487aea4efcdfd70812222b1bd005e270242b.tar.gz snowflake-3185487aea4efcdfd70812222b1bd005e270242b.zip |
update formatTraffic so that bandwidth unit is always KB
-rw-r--r-- | proxy/lib/util.go | 14 |
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" } |