'Run any necessary calculations on the data collected from the logs
and return a list of metric objects.'

def get_state(self, duration):

    duration = float(duration)
    metrics = []
    if (duration > 0):
        metrics += [MetricObject(counter, (self.counts[counter] / duration)) for counter in self.counts]
    for time_name in self.times:
        values = self.times[time_name]['values']
        unit = self.times[time_name]['unit']
        metrics.append(MetricObject((time_name + '.mean'), stats_helper.find_mean(values), unit))
        metrics.append(MetricObject((time_name + '.median'), stats_helper.find_median(values), unit))
        metrics += [MetricObject(('%s.%sth_percentile' % (time_name, percentile)), stats_helper.find_percentile(values, int(percentile)), unit) for percentile in self.percentiles]
    return metrics
