'Send multiple samples.
The usecase here is to reduce the chatter and send the counters
at a slower cadence.'

def test_multiple_samples(self):

    samples = []
    for x in range(6):
        dt = datetime.datetime(2012, 8, 27, x, 0, tzinfo=None)
        s = {'counter_name': 'apples', 'counter_type': 'gauge', 'counter_unit': 'instance', 'counter_volume': float((x * 3)), 'source': 'evil', 'timestamp': dt.isoformat(), 'resource_id': 'bd9431c1-8d69-4ad3-803a-8d4a6b89fd36', 'project_id': '35b17138-b364-4e6a-a131-8f3099c5be68', 'user_id': 'efd87807-12d2-4b38-9c70-5f5c2ac427ff', 'resource_metadata': {'name1': str(x), 'name2': str((x + 4))}}
        samples.append(s)
    data = self.post_json('/meters/apples/', samples)
    for (x, s) in enumerate(samples):
        s['source'] = ('%s:%s' % (s['project_id'], s['source']))
        s['message_id'] = data.json[x]['message_id']
        c = data.json[x]
        timestamp = timeutils.parse_isotime(c['timestamp'])
        c['timestamp'] = timestamp.replace(tzinfo=None).isoformat()
        msg = self.published[0][x]
        timestamp = timeutils.parse_isotime(msg['timestamp'])
        msg['timestamp'] = timestamp.replace(tzinfo=None).isoformat()
        self.assertEqual(s, c)
        s['monotonic_time'] = None
        self.assertEqual(s, self.published[0][x])
