Skip to content

Instantly share code, notes, and snippets.

@guixing
Created August 18, 2013 08:55
Show Gist options
  • Save guixing/6260639 to your computer and use it in GitHub Desktop.
Save guixing/6260639 to your computer and use it in GitHub Desktop.
import socket
import datetime
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', 2003))
now = datetime.datetime.now()
onehour = datetime.timedelta(days=1)
h = now - onehour
minute = datetime.timedelta(minutes=1)
import random
for i in range(1440):
h = h + minute
s = 'test.http_200 %d %s\n' % (random.randint(50,100), h.strftime('%s'))
s = 'test.http_404 %d %s\n' % (random.randint(50,100), h.strftime('%s'))
sock.send(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment