'Turn a metric into a well-formed metric name
prefix.b.c'

def normalize(self, metric, prefix=None):

    name = re.sub('[,\\+\\*\\-/()\\[\\]{}\\s]', '_', metric)
    name = re.sub('__+', '_', name)
    name = re.sub('^_', '', name)
    name = re.sub('_$', '', name)
    name = re.sub('\\._', '.', name)
    name = re.sub('_\\.', '.', name)
    if (prefix is not None):
        return ((prefix + '.') + name)
    else:
        return name
