properly report bandwidth if not configured (#4641)

report bandwidth if not configured
This commit is contained in:
Harshavardhana
2023-07-19 12:42:18 -07:00
committed by GitHub
parent 493cd196b7
commit c5ea09b74d
3 changed files with 12 additions and 10 deletions
+8 -6
View File
@@ -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)))
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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=