def run(sock, delay):
    while True:
        now = int(time.time())
        tuples = ([])
        lines = []
        #We're gonna report all three loadavg values
        loadavg = get_loadavg()
        tuples.append(('system.loadavg_1min', (now,loadavg[0])))
        tuples.append(('system.loadavg_5min', (now,loadavg[1])))
        tuples.append(('system.loadavg_15min', (now,loadavg[2])))
        lines.append("system.loadavg_1min %s %d" % (loadavg[0], now))
        lines.append("system.loadavg_5min %s %d" % (loadavg[1], now))
        lines.append("system.loadavg_15min %s %d" % (loadavg[2], now))
        message = '\n'.join(lines) + '\n' #all lines must end in a newline
        print "sending message"
        print '-' * 80
        print message
        package = pickle.dumps(tuples, 1)
        size = struct.pack('!L', len(package))
        sock.sendall(size)
        sock.sendall(package)
        time.sleep(delay)
Make the client go go go
dataset/ETHPy150Open graphite-project/carbon/examples/example-pickle-client.py/run