'Rotate the transfer counters.
If sufficient time has passed, then rotate the counters from active to
the prior-block of counts.
This rotation is interlocked to ensure that multiple threads do not
over-rotate the counts.
Args:
throttle_name: The name of the throttle to rotate.'

def _RotateCounts(self, throttle_name):

    self.VerifyThrottleName(throttle_name)
    self.rotate_mutex[throttle_name].acquire()
    try:
        next_rotate_time = (self.last_rotate[throttle_name] + self.ROTATE_PERIOD)
        if (next_rotate_time >= self.get_time()):
            return
        for (name, count) in self.transferred[throttle_name].items():
            self.prior_block[throttle_name][name] = count
            self.transferred[throttle_name][name] = 0
            self.totals[throttle_name][name] += count
        self.last_rotate[throttle_name] = self.get_time()
    finally:
        self.rotate_mutex[throttle_name].release()
