MCPcopy
hub / github.com/NVIDIA/aistore / BenchmarkRebalance

Function BenchmarkRebalance

bench/integration/act_bench_test.go:152–186  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

150}
151
152func BenchmarkRebalance(b *testing.B) {
153 const (
154 bckSize = cos.GiB
155 )
156 var (
157 proxyURL = tutils.RandomProxyURL()
158 baseParams = tutils.BaseAPIParams(proxyURL)
159 bck = cmn.Bck{
160 Name: "bench-reb",
161 Provider: apc.ProviderAIS,
162 }
163 )
164
165 for _, size := range objSizes {
166 objCount := int(bckSize/size) + 1
167 tutils.CreateBucketWithCleanup(b, proxyURL, bck, nil)
168
169 smap, err := api.GetClusterMap(baseParams)
170 tassert.CheckFatal(b, err)
171 tgtLost, err := smap.GetRandTarget()
172 tassert.CheckFatal(b, err)
173
174 args := &apc.ActValRmNode{DaemonID: tgtLost.ID(), SkipRebalance: true}
175 _, err = api.StartMaintenance(baseParams, args)
176 tassert.CheckFatal(b, err)
177 fillBucket(b, proxyURL, bck, uint64(size), objCount)
178
179 b.Run("rebalance", func(b *testing.B) {
180 args := &apc.ActValRmNode{DaemonID: tgtLost.ID()}
181 _, err := api.StopMaintenance(baseParams, args)
182 tassert.CheckError(b, err)
183 tutils.WaitForRebalAndResil(b, baseParams, rebalanceTime)
184 })
185 }
186}

Callers

nothing calls this directly

Calls 13

RandomProxyURLFunction · 0.92
BaseAPIParamsFunction · 0.92
CreateBucketWithCleanupFunction · 0.92
GetClusterMapFunction · 0.92
CheckFatalFunction · 0.92
StartMaintenanceFunction · 0.92
StopMaintenanceFunction · 0.92
CheckErrorFunction · 0.92
WaitForRebalAndResilFunction · 0.92
fillBucketFunction · 0.85
GetRandTargetMethod · 0.80
IDMethod · 0.65

Tested by

no test coverage detected