summaryrefslogtreecommitdiff
path: root/benchmarks/consumer_performance.py
diff options
context:
space:
mode:
authorJeff Widman <jeff@jeffwidman.com>2018-10-22 01:24:50 -0700
committerJeff Widman <jeff@jeffwidman.com>2018-10-22 01:24:50 -0700
commitc6d86b25be338b78c79ec9a0f20a365e67e36537 (patch)
tree356b2b35146b83407717bf6d79d2997017b67ba0 /benchmarks/consumer_performance.py
parent08c77499a2e8bc79d6788d70ef96d77752ed6325 (diff)
downloadkafka-python-vendor-six-consistently.tar.gz
Vendor `six` consistentlyvendor-six-consistently
Use vendored `six`, and also `six.moves.range` rather than `xrange`
Diffstat (limited to 'benchmarks/consumer_performance.py')
-rwxr-xr-xbenchmarks/consumer_performance.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/benchmarks/consumer_performance.py b/benchmarks/consumer_performance.py
index 3e879ae..5ffd3f5 100755
--- a/benchmarks/consumer_performance.py
+++ b/benchmarks/consumer_performance.py
@@ -10,6 +10,8 @@ import sys
import threading
import traceback
+from kafka.vendor.six.moves import range
+
from kafka import KafkaConsumer, KafkaProducer
from test.fixtures import KafkaFixture, ZookeeperFixture
@@ -64,7 +66,7 @@ class ConsumerPerformance(object):
record = bytes(bytearray(args.record_size))
producer = KafkaProducer(compression_type=args.fixture_compression,
**props)
- for i in xrange(args.num_records):
+ for i in range(args.num_records):
producer.send(topic=args.topic, value=record)
producer.flush()
producer.close()