diff options
Diffstat (limited to 'benchmarks')
-rwxr-xr-x | benchmarks/consumer_performance.py | 4 | ||||
-rwxr-xr-x | benchmarks/producer_performance.py | 4 | ||||
-rw-r--r-- | benchmarks/varint_speed.py | 2 |
3 files changed, 7 insertions, 3 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() diff --git a/benchmarks/producer_performance.py b/benchmarks/producer_performance.py index e958735..0c29cbc 100755 --- a/benchmarks/producer_performance.py +++ b/benchmarks/producer_performance.py @@ -9,6 +9,8 @@ import sys import threading import traceback +from kafka.vendor.six.moves import range + from kafka import KafkaProducer from test.fixtures import KafkaFixture, ZookeeperFixture @@ -77,7 +79,7 @@ class ProducerPerformance(object): print('-> OK!') print() - for i in xrange(args.num_records): + for i in range(args.num_records): producer.send(topic=args.topic, value=record) producer.flush() diff --git a/benchmarks/varint_speed.py b/benchmarks/varint_speed.py index 2c5cd62..624a12a 100644 --- a/benchmarks/varint_speed.py +++ b/benchmarks/varint_speed.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from __future__ import print_function import perf -import six +from kafka.vendor import six test_data = [ |