Permalink
Browse files

adding hstore simulator

  • Loading branch information...
jmeehan16 committed Aug 26, 2014
1 parent 2af943f commit 207d104e38ec79f74adaf059493a3a7225a2272a
Showing with 11,756 additions and 0 deletions.
  1. +50 −0 demo/simulatehstore.py
  2. +5,909 −0 logs/demohstoreout-full.txt
  3. +5,797 −0 logs/hstorecontestants-full.txt
View
@@ -0,0 +1,50 @@
import socket
import sys, argparse
import time
import Queue
from threading import Semaphore
from thread import *
c_lines = []
v_lines = []
c_index = 0
v_index = 0
CONTESTANTS_INFILE = '../logs/hstorecontestants-full.txt'
CONTESTANTS_OUTFILE = '../logs/hstorecontestants.txt'
VOTES_INFILE = '../logs/demohstoreout-full.txt'
VOTES_OUTFILE = '../logs/demohstorecurrent.txt'
def getlines(filename, lines):
f = open(filename, 'r')
for line in f:
lines.append(line)
f.close()
def printcontestants(filename):
f = open(filename, 'w')
global c_lines
global c_index
f.write(c_lines[c_index])
c_index+=1
while not c_lines[c_index].startswith('#'):
f.write(c_lines[c_index])
c_index+=1
def printvotes(filename):
f = open(filename, 'w')
global v_lines
global v_index
f.write(v_lines[v_index])
v_index+=1
while not v_lines[v_index].startswith('#'):
f.write(v_lines[v_index])
v_index+=1
getlines(CONTESTANTS_INFILE, c_lines)
getlines(VOTES_INFILE, v_lines)
print "waiting for S-Store to start"
time.sleep(15)
while v_index < len(v_lines) - 1:
printcontestants(CONTESTANTS_OUTFILE)
printvotes(VOTES_OUTFILE)
time.sleep(1)
Oops, something went wrong.

0 comments on commit 207d104

Please sign in to comment.