(b *testing.B)
| 150 | } |
| 151 | |
| 152 | func 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 | } |
nothing calls this directly
no test coverage detected