def _send_picklemetrics(metrics):
 metrics = [(metric_name, (timestamp, value)) for (metric_name, value, timestamp) in metrics]
 data = cPickle.dumps(metrics, (-1))
 payload = (struct.pack('!L', len(data)) + data)
 return payload

def _send_picklemetrics ( metrics ) : metrics = [ ( metric_name , ( timestamp , value ) ) for ( metric_name , value , timestamp ) in metrics ] data = cPickle . dumps ( metrics , ( - 1 ) ) payload = ( struct . pack ( '!L' , len ( data ) ) + data ) return payload
format metrics for the carbon pickle protocol .