diff options
-rw-r--r-- | kafka/consumer/group.py | 4 | ||||
-rw-r--r-- | kafka/producer/kafka.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index 8727de7..699b02b 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -903,10 +903,10 @@ class KafkaConsumer(six.Iterator): releases without warning. """ if raw: - return self._metrics.metrics + return self._metrics.metrics.copy() metrics = {} - for k, v in six.iteritems(self._metrics.metrics): + for k, v in six.iteritems(self._metrics.metrics.copy()): if k.group not in metrics: metrics[k.group] = {} if k.name not in metrics[k.group]: diff --git a/kafka/producer/kafka.py b/kafka/producer/kafka.py index 685c3f9..ccdd91a 100644 --- a/kafka/producer/kafka.py +++ b/kafka/producer/kafka.py @@ -716,10 +716,10 @@ class KafkaProducer(object): releases without warning. """ if raw: - return self._metrics.metrics + return self._metrics.metrics.copy() metrics = {} - for k, v in six.iteritems(self._metrics.metrics): + for k, v in six.iteritems(self._metrics.metrics.copy()): if k.group not in metrics: metrics[k.group] = {} if k.name not in metrics[k.group]: |