Fix superfluous GET requests in swift-bench.

If you specified num_gets = 0 for a benchmarking run (say, if you're
benchmarking PUT rate), you'd still get each swift-bench-client
process doing 1 GET request. Now you don't.

This should also fix the case where you've got more objects than
swift-bench-client processes, for example when you're uploading a few
large objects and then doing lots of parallel GETs of those
objects. Now you'll get the number requested, not
max(number-requested, number-of-bench-clients).

Change-Id: Ied9eb733dd9af51a3c6af8b815ad6cff0ff746b7
This commit is contained in:
Samuel Merritt 2013-01-21 15:38:31 -08:00
parent 3814f9fcdd
commit 035e49cf4b

View File

@ -293,9 +293,13 @@ class DistributedBenchController(object):
'INFO (\d+) (.*) \*\*FINAL\*\* \[(\d+) failures\], (\d+\.\d+)/s')
self.clients = conf.bench_clients
del conf.bench_clients
for k in ['put_concurrency', 'get_concurrency', 'del_concurrency',
'num_objects', 'num_gets']:
setattr(conf, k, max(1, int(getattr(conf, k)) / len(self.clients)))
for key, minval in [('put_concurrency', 1),
('get_concurrency', 1),
('del_concurrency', 1),
('num_objects', 0),
('num_gets', 0)]:
setattr(conf, key,
max(minval, int(getattr(conf, key)) / len(self.clients)))
self.conf = conf
def run(self):