summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Merritt <sam@swiftstack.com>2013-01-21 15:38:31 -0800
committerSamuel Merritt <sam@swiftstack.com>2013-01-21 15:38:31 -0800
commitf3ec69e54709eb9c9f9e8bc28cc13bf1214c50ad (patch)
treedcfc7cf7a7850a19424ab33855ac89a8b08c2878
parentbf980693d980f6c1f932220aa0261946e9310e8d (diff)
downloadswift-bench-f3ec69e54709eb9c9f9e8bc28cc13bf1214c50ad.tar.gz
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
-rw-r--r--swift/common/bench.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/swift/common/bench.py b/swift/common/bench.py
index 7eef51a..c6da410 100644
--- a/swift/common/bench.py
+++ b/swift/common/bench.py
@@ -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):