def METHOD_NAME(self):
    metrics = self.queue.flush()
    if len(metrics) == 0:
        return
    clock = int(time.time())
    data = json.dumps({
        'request': 'sender data',
        'data': metrics,
        'clock': clock
    })
    sent_all = self._send_data(data)
    if not sent_all and self.re_send:
        for metric in metrics:
            data = json.dumps({
                'request': 'sender data',
                'data': [metric],
                'clock': clock
            })
            self._send_data(data)