'Given a set of values (as returned from ``get_range``), roll them up
using the ``rollup`` time (in seconds).'

def rollup(self, values, rollup):

    normalize_ts_to_epoch = self.normalize_ts_to_epoch
    result = {}
    for (key, points) in six.iteritems(values):
        result[key] = []
        last_new_ts = None
        for (ts, count) in points:
            new_ts = normalize_ts_to_epoch(ts, rollup)
            if (new_ts == last_new_ts):
                result[key][(-1)][1] += count
            else:
                result[key].append([new_ts, count])
                last_new_ts = new_ts
    return result
