Skip to content

Commit

Permalink
CLI 'performance throughput': fix cluster totals
Browse files Browse the repository at this point in the history
* part two

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Jan 23, 2025
1 parent 75576ef commit 8990fcb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 25 deletions.
9 changes: 2 additions & 7 deletions cmd/cli/cli/performance.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ func showThroughputHandler(c *cli.Context) error {
return showPerfTab(c, selected, _throughput /*cb*/, cmdShowThroughput, totals, true)
}

// TODO -- FIXME: move
func _sizeToCount(name string) string {
return strings.TrimSuffix(name, ".size") + ".n"
}

// update mapBegin <= (size/s)
func _throughput(c *cli.Context, metrics cos.StrKVs, mapBegin, mapEnd teb.StstMap, elapsed time.Duration) (idle bool) {
var (
Expand All @@ -255,19 +250,19 @@ func _throughput(c *cli.Context, metrics cos.StrKVs, mapBegin, mapEnd teb.StstMa
if !ok || kind != stats.KindSize {
continue
}
bpsName := stats.SizeToThroughput(name, stats.KindSize)
bpsName, cntName := stats.SizeToThroughputCount(name, stats.KindSize)
if bpsName == "" {
continue
}

// - check (begin, end) counters
// - zero-out resulting throughput when no change
var (
cntName = _sizeToCount(name)
cntBegin, okb = begin.Tracker[cntName]
cntEnd, oke = end.Tracker[cntName]
)
if okb && oke && cntBegin.Value >= cntEnd.Value {
debug.Assert(cntBegin.Value == cntEnd.Value, cntName, ": ", cntBegin.Value, " vs ", cntEnd.Value)
v.Value = 0
begin.Tracker[bpsName] = v
continue
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/cli
go 1.23.4

require (
github.com/NVIDIA/aistore v1.3.26-0.20250122163924-dbf047a8e977
github.com/NVIDIA/aistore v1.3.26-0.20250123153238-75576ef8dd88
github.com/fatih/color v1.18.0
github.com/json-iterator/go v1.1.12
github.com/onsi/ginkgo/v2 v2.21.0
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/NVIDIA/aistore v1.3.26-0.20250122163924-dbf047a8e977 h1:qXckIwe3nDH2Wn4KufyrIRg5pzAenhq9JY65zkTVnwM=
github.com/NVIDIA/aistore v1.3.26-0.20250122163924-dbf047a8e977/go.mod h1:rbl6S+ehV6m949UsHJA1Iz2+76/lZHwDm/KcfUnt9fw=
github.com/NVIDIA/aistore v1.3.26-0.20250123153238-75576ef8dd88 h1:TexGR0hAiKtbhDofOCtVMqaBYFgj4eqZ8AA0HQQOxEA=
github.com/NVIDIA/aistore v1.3.26-0.20250123153238-75576ef8dd88/go.mod h1:rbl6S+ehV6m949UsHJA1Iz2+76/lZHwDm/KcfUnt9fw=
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
Expand Down
2 changes: 1 addition & 1 deletion cmd/ishard/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/ishard
go 1.23.4

require (
github.com/NVIDIA/aistore v1.3.26-0.20250122163924-dbf047a8e977
github.com/NVIDIA/aistore v1.3.26-0.20250123153238-75576ef8dd88
github.com/json-iterator/go v1.1.12
github.com/vbauerster/mpb/v4 v4.12.2
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/ishard/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
github.com/NVIDIA/aistore v1.3.26-0.20250122163924-dbf047a8e977 h1:qXckIwe3nDH2Wn4KufyrIRg5pzAenhq9JY65zkTVnwM=
github.com/NVIDIA/aistore v1.3.26-0.20250122163924-dbf047a8e977/go.mod h1:rbl6S+ehV6m949UsHJA1Iz2+76/lZHwDm/KcfUnt9fw=
github.com/NVIDIA/aistore v1.3.26-0.20250123153238-75576ef8dd88 h1:TexGR0hAiKtbhDofOCtVMqaBYFgj4eqZ8AA0HQQOxEA=
github.com/NVIDIA/aistore v1.3.26-0.20250123153238-75576ef8dd88/go.mod h1:rbl6S+ehV6m949UsHJA1Iz2+76/lZHwDm/KcfUnt9fw=
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=
Expand Down
12 changes: 0 additions & 12 deletions stats/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ func LatencyToCounter(latName string) string {
return ""
}

// TODO -- FIXME: remove
func SizeToThroughput(name, kind string) string {
if kind != KindSize {
return ""
}
if !strings.HasSuffix(name, ".size") { // see stats/common for "Naming conventions"
debug.Assert(false, name)
return ""
}
return strings.TrimSuffix(name, ".size") + ".bps"
}

func SizeToThroughputCount(name, kind string) (string, string) {
if kind != KindSize {
return "", ""
Expand Down

0 comments on commit 8990fcb

Please sign in to comment.