diff --git a/cmd/replicate-status.go b/cmd/replicate-status.go index 39afb800..912c5ff9 100644 --- a/cmd/replicate-status.go +++ b/cmd/replicate-status.go @@ -225,13 +225,15 @@ func (s replicateStatusMessage) String() string { rows += r rows += "\n" bwStat, ok := s.ReplicationStatus.Stats[arn] - if ok && bwStat.BandWidthLimitInBytesPerSecond > 0 { - limit := humanize.Bytes(uint64(bwStat.BandWidthLimitInBytesPerSecond)) - current := humanize.Bytes(uint64(bwStat.CurrentBandwidthInBytesPerSecond)) - if bwStat.BandWidthLimitInBytesPerSecond == 0 { - limit = "N/A" // N/A means cluster bandwidth is not configured + if ok { + limit := "N/A" // N/A means cluster bandwidth is not configured + current := "N/A" // N/A means there is + if bwStat.CurrentBandwidthInBytesPerSecond > 0 { + current = humanize.Bytes(uint64(bwStat.CurrentBandwidthInBytesPerSecond)) + } + if bwStat.BandWidthLimitInBytesPerSecond > 0 { + limit = humanize.Bytes(uint64(bwStat.BandWidthLimitInBytesPerSecond)) } - r = console.Colorize("THeaderBold", newPrettyTable("", Field{"B/w limit Hdr", 80}, ).buildRow(" Configured Max Bandwidth (Bps): "+console.Colorize("Values", limit))) diff --git a/go.mod b/go.mod index 079e2099..da68b014 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/gdamore/tcell/v2 v2.6.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/juju/ratelimit v1.0.2 - github.com/minio/madmin-go/v3 v3.0.7 + github.com/minio/madmin-go/v3 v3.0.8 github.com/muesli/reflow v0.3.0 github.com/navidys/tvxwidgets v0.3.0 github.com/olekukonko/tablewriter v0.0.5 @@ -103,7 +103,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/procfs v0.9.0 github.com/rivo/uniseg v0.4.4 // indirect github.com/secure-io/sio-go v0.3.1 // indirect github.com/sirupsen/logrus v1.9.2 // indirect diff --git a/go.sum b/go.sum index 67558363..df1ad412 100644 --- a/go.sum +++ b/go.sum @@ -146,8 +146,8 @@ github.com/minio/colorjson v1.0.5 h1:P//d521blE5cKDF5YvsHcpqb9TE8IwCdliSv1naPsgk github.com/minio/colorjson v1.0.5/go.mod h1:Oq6oB83q+sL08u9wx68+91ELf0nV5G4c6l9pQcH5ElI= github.com/minio/filepath v1.0.0 h1:fvkJu1+6X+ECRA6G3+JJETj4QeAYO9sV43I79H8ubDY= github.com/minio/filepath v1.0.0/go.mod h1:/nRZA2ldl5z6jT9/KQuvZcQlxZIMQoFFQPvEXx9T/Bw= -github.com/minio/madmin-go/v3 v3.0.7 h1:nuRwrqarFrkzbUiA36H/HKAcuNr8J9TjKlWRlua7lNo= -github.com/minio/madmin-go/v3 v3.0.7/go.mod h1:lPrMoc1aeiIWmmrxBthkDqzMPQwC/Lu9ByuyM2wenJk= +github.com/minio/madmin-go/v3 v3.0.8 h1:oY+siBnw7+aJg5Idx2nPguP/10TeLekBTmJiUO+buAI= +github.com/minio/madmin-go/v3 v3.0.8/go.mod h1:lPrMoc1aeiIWmmrxBthkDqzMPQwC/Lu9ByuyM2wenJk= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v7 v7.0.57 h1:xsFiOiWjpC1XAGbFEUOzj1/gMXGz7ljfxifwcb/5YXU=