def METHOD_NAME(self, compress_mock):
    log = mock.Mock()
    nb_series = 10000
    max_compressed_size = 1 << 10  # 1KB, well below the original size of our payload of 10000 metrics
    metrics_payload = {"series": [
        {
            "metric": "%d" % i,  # use an integer so that it's easy to find the metric afterwards
            "points": [(i, i)],
            "source_type_name": "System",
        } for i in xrange(nb_series)
    ]}
    compressed_payloads = serialize_and_compress_metrics_payload(metrics_payload, max_compressed_size, 0, log)
    # check that all the payloads are smaller than the max size
    for compressed_payload in compressed_payloads:
        self.assertLess(len(compressed_payload), max_compressed_size)
    # check that all the series are there (correct number + correct metric names)
    series_after = []
    for compressed_payload in compressed_payloads:
        series_after.extend(json.loads(compressed_payload)["series"])
    self.assertEqual(nb_series, len(series_after))
    metrics_sorted = sorted([int(metric["metric"]) for metric in series_after])
    for i, metric_name in enumerate(metrics_sorted):
        self.assertEqual(i, metric_name)