'Resolve metric names and types and submit it.'

def _submit_metrics(self, metrics, metric_name_and_type_by_property):

    for metric in metrics:
        if (metric.name not in metric_name_and_type_by_property):
            continue
        (metric_name, metric_type) = metric_name_and_type_by_property[metric.name]
        try:
            func = getattr(self, metric_type.lower())
        except AttributeError:
            raise Exception(u'Invalid    metric    type:    {0}'.format(metric_type))
        func(metric_name, metric.value, metric.tags)
