From 8990fcb4de6f650f7e036695e413c2d7fa0bbab3 Mon Sep 17 00:00:00 2001 From: Alex Aizman Date: Thu, 23 Jan 2025 10:47:08 -0500 Subject: [PATCH] CLI 'performance throughput': fix cluster totals * part two Signed-off-by: Alex Aizman --- cmd/cli/cli/performance.go | 9 ++------- cmd/cli/go.mod | 2 +- cmd/cli/go.sum | 4 ++-- cmd/ishard/go.mod | 2 +- cmd/ishard/go.sum | 4 ++-- stats/api.go | 12 ------------ 6 files changed, 8 insertions(+), 25 deletions(-) diff --git a/cmd/cli/cli/performance.go b/cmd/cli/cli/performance.go index 8e301532256..5a61dda8e45 100644 --- a/cmd/cli/cli/performance.go +++ b/cmd/cli/cli/performance.go @@ -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 ( @@ -255,7 +250,7 @@ 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 } @@ -263,11 +258,11 @@ func _throughput(c *cli.Context, metrics cos.StrKVs, mapBegin, mapEnd teb.StstMa // - 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 diff --git a/cmd/cli/go.mod b/cmd/cli/go.mod index 8c9e0985326..d9dc1b4adfe 100644 --- a/cmd/cli/go.mod +++ b/cmd/cli/go.mod @@ -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 diff --git a/cmd/cli/go.sum b/cmd/cli/go.sum index 411f9acc939..8f0540ef7fb 100644 --- a/cmd/cli/go.sum +++ b/cmd/cli/go.sum @@ -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= diff --git a/cmd/ishard/go.mod b/cmd/ishard/go.mod index 3d96b8a874c..3f07e72200b 100644 --- a/cmd/ishard/go.mod +++ b/cmd/ishard/go.mod @@ -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 ) diff --git a/cmd/ishard/go.sum b/cmd/ishard/go.sum index 6c80edb818f..c5dcbc9f4ea 100644 --- a/cmd/ishard/go.sum +++ b/cmd/ishard/go.sum @@ -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= diff --git a/stats/api.go b/stats/api.go index 8505152eb4b..51a65204d5f 100644 --- a/stats/api.go +++ b/stats/api.go @@ -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 "", ""