def runner_a(): data = Data(PREFIX+DATAFILE1) mc = Client(data, freq=CMD_FREQ) for bucket in sorted(data.buckets): mc.setter_fixed_random(bucket, DURATION)
def runner_b(): data = Data(PREFIX+DATAFILE2) mc = Client(data, freq=CMD_FREQ) time.sleep(DURATION * len(data.buckets) * 2) for bucket in sorted(data.buckets): mc.setter_fixed_random(bucket, DURATION)
def worker(data): mc = Client(data, freq=FREQ) mc.setter_random_random(DURATION)
''' import sys import os.path import random from lib.utilities import * from lib.common import Client, Data DURATION = 5 FREQ = 100 server = startServer() data = Data(os.path.expanduser(TESTS_PATH) + '/data/data.config') mc = Client(data, freq=FREQ) bucket = data.buckets[random.randrange(len(data.buckets))] print "Testing setter_fixed_single" mc.setter_fixed_single(bucket, 1, DURATION) print "Testing getter_fixed_single" mc.getter_fixed_single(bucket, 1, DURATION) bucket = data.buckets[random.randrange(len(data.buckets))] print "Testing setter_fixed_random" mc.setter_fixed_random(bucket, DURATION) print "Testing getter_fixed_random" mc.getter_fixed_random(bucket, DURATION) bucket = data.buckets[random.randrange(len(data.buckets))] print "Testing setter_fixed_unbounded" mc.setter_fixed_unbounded(bucket, DURATION)
''' import sys import os.path import random from lib.utilities import * from lib.common import Client, Data DURATION = 5 FREQ = 100 server = startServer() data = Data(os.path.expanduser(TESTS_PATH)+'/data/data.config') mc = Client(data, freq=FREQ) bucket = data.buckets[random.randrange(len(data.buckets))] print"Testing setter_fixed_single" mc.setter_fixed_single(bucket, 1, DURATION) print"Testing getter_fixed_single" mc.getter_fixed_single(bucket, 1, DURATION) bucket = data.buckets[random.randrange(len(data.buckets))] print"Testing setter_fixed_random" mc.setter_fixed_random(bucket, DURATION) print"Testing getter_fixed_random" mc.getter_fixed_random(bucket, DURATION) bucket = data.buckets[random.randrange(len(data.buckets))] print"Testing setter_fixed_unbounded" mc.setter_fixed_unbounded(bucket, DURATION)
def runner_b(): data = Data(PREFIX + DATAFILE2) mc = Client(data, freq=CMD_FREQ) time.sleep(DURATION * len(data.buckets) * 2) for bucket in sorted(data.buckets): mc.setter_fixed_random(bucket, DURATION)
def runner_a(): data = Data(PREFIX + DATAFILE1) mc = Client(data, freq=CMD_FREQ) for bucket in sorted(data.buckets): mc.setter_fixed_random(bucket, DURATION)