def register_metric(self, name, metric, time_bucket_in_sec):
if name in self.metrics_map:<EOL><INDENT>raise RuntimeError("<STR_LIT>" % name)<EOL><DEDENT>Log.debug("<STR_LIT>", name, str(time_bucket_in_sec))<EOL>self.metrics_map[name] = metric<EOL>if time_bucket_in_sec in self.time_bucket_in_sec_to_metrics_name:<EOL><INDENT>self.time_bucket_in_sec_to_metrics_name[time_bucket_in_sec].append(name)<EOL><DEDENT>else:<EOL><INDENT>self.time_bucket_in_sec_to_metrics_name[time_bucket_in_sec] = [name]<EOL>self._register_timer_task(time_bucket_in_sec)<EOL><DEDENT>
Registers a given metric

        :param name: name of the metric
        :param metric: IMetric object to be registered
        :param time_bucket_in_sec: time interval for update to the metrics manager