def register_metric(self, metric):
        with self._lock:
            if metric.metric_name in self.metrics:
                raise ValueError('A metric named "%s" already exists, cannot'
                                 ' register another one.' % metric.metric_name)
            self.metrics[metric.metric_name] = metric
            for reporter in self._reporters:
                reporter.metric_change(metric)
dataset/ETHPy150Open dpkp/kafka-python/kafka/metrics/metrics.py/Metrics.register_metric/original