

def _rate(self, sample1, sample2):
    interval = (sample2[0] - sample1[0])
    if (interval == 0):
        log.warn(('Metric %s has an interval of 0. Not flushing.' % self.name))
        raise Infinity()
    delta = (sample2[1] - sample1[1])
    if (delta < 0):
        log.info(('Metric %s has a rate < 0. Counter may have been Reset.' % self.name))
        raise UnknownValue()
    return (delta / float(interval))

dataset/ETHPy150Open serverdensity/sd-agent/aggregator.py Rate._rate/original