diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-10-22 01:24:50 -0700 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-10-22 14:30:33 -0700 |
commit | b83feeca2ec6f6ad745fb7ea47c6484304bb55d8 (patch) | |
tree | 7580e387521b388f3af629b9d25278faa26ee349 /benchmarks | |
parent | a6be21e7b3a20ce2e25ef26140c43b59cc356f38 (diff) | |
download | kafka-python-b83feeca2ec6f6ad745fb7ea47c6484304bb55d8.tar.gz |
Vendor `six` consistently
Use vendored `six`, and also `six.moves.range` rather than `xrange`
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 = [ |