Iterates over histogram data, yielding metric-value pairs.

def parse_histogram(metric, histogram):
    """Iterates over histogram data, yielding metric-value pairs."""
    for match in HISTOGRAM.finditer(histogram):
        percentile, value = match.groups()
        value = float(value)

        if not isnan(value):
            try:
                yield metric + PERCENTILE_SUFFIX[percentile], value

            # In case Envoy adds more
            except KeyError:
                yield '{}.{}percentile'.format(metric, percentile[1:].replace('.', '_')), value