def METHOD_NAME(self, metric_type, utcnow):
    metric_name = "test_gauge_or_ms"
    metric_key = metric_name + "|" + metric_type
    utcnow.return_value = utils.datetime_utc(2015, 1, 7, 13, 58, 36)
    self.server.datagram_received(
        ("%s:1|%s" % (metric_name, metric_type)).encode('ascii'),
        ("127.0.0.1", 12345))
    self.stats.flush()
    r = self.stats.indexer.get_resource('generic',
                                        self.conf.statsd.resource_id,
                                        with_metrics=True)
    metric = r.get_metric(metric_key)
    self.trigger_processing([metric])
    measures = self.storage.get_aggregated_measures(
        {metric: self.aggregations})[metric]
    measures = get_measures_list(measures)
    self.assertEqual({"mean": [
        (datetime64(2015, 1, 7), numpy.timedelta64(1, 'D'), 1.0),
        (datetime64(2015, 1, 7, 13), numpy.timedelta64(1, 'h'), 1.0),
        (datetime64(2015, 1, 7, 13, 58), numpy.timedelta64(1, 'm'), 1.0)
    ]}, measures)
    utcnow.return_value = utils.datetime_utc(2015, 1, 7, 13, 59, 37)
    # This one is going to be ignored
    self.server.datagram_received(
        ("%s:45|%s" % (metric_name, metric_type)).encode('ascii'),
        ("127.0.0.1", 12345))
    self.server.datagram_received(
        ("%s:2|%s" % (metric_name, metric_type)).encode('ascii'),
        ("127.0.0.1", 12345))
    self.stats.flush()
    self.trigger_processing([metric])
    measures = self.storage.get_aggregated_measures(
        {metric: self.aggregations})[metric]
    measures = get_measures_list(measures)
    self.assertEqual({"mean": [
        (datetime64(2015, 1, 7), numpy.timedelta64(1, 'D'), 1.5),
        (datetime64(2015, 1, 7, 13), numpy.timedelta64(1, 'h'), 1.5),
        (datetime64(2015, 1, 7, 13, 58), numpy.timedelta64(1, 'm'), 1.0),
        (datetime64(2015, 1, 7, 13, 59), numpy.timedelta64(1, 'm'), 2.0)
    ]}, measures)