

def __init__(self, metric, source):
    '\n    Args:\n      metric - The metric name.\n      source - An optional source.\n    '
    self._metric = metric
    self._source = source
    if (self.VARZ_TYPE == VarzType.Gauge):
        self._fn = VarzReceiver.SetVarz
    elif (self.VARZ_TYPE in (VarzType.AverageTimer, VarzType.AverageRate)):
        self._fn = VarzReceiver.RecordPercentileSample
    else:
        self._fn = VarzReceiver.IncrementVarz
    if source:
        self._fn = functools.partial(self._fn, self._source)
    else:
        self._fn = self._Adapt(self._fn)

dataset/ETHPy150Open steveniemitz/scales/scales/varz.py VarzMetric.__init__/original