Example #1
0
    def __init__(self):
        """
        Initialize tests
        """
        Logger.getLogger("net.spy.memcached").setLevel(Level.DEBUG)
        self.clients = []
        if USE_GLOBAL_CLIENT:
            # use global client
            self.client = global_client
        else:
            cfb = ConnectionFactoryBuilder()
            self.client = ArcusClient.createArcusClient(
                arcus_cloud, service_code, cfb)

        print 'Wait for per-thread client to be connected to Arcus cloud (%d seconds)' % DEFAULT_CONNECTION_WAIT
        Thread.currentThread().sleep(DEFAULT_CONNECTION_WAIT * 1000)

        self.flush_counter = 0

        self.tests = []

        # insert operations
        self.tests.append(Test(1, "KeyValue").wrap(self.KeyValue))
        self.tests.append(
            Test(2, "Collection_Btree").wrap(self.Collection_Btree))
        self.tests.append(Test(3, "Collection_Set").wrap(self.Collection_Set))
        self.tests.append(
            Test(4, "Collection_List").wrap(self.Collection_List))
    def __init__(self):
        """
        Initialize tests
        """
        Logger.getLogger("net.spy.memcached").setLevel(Level.DEBUG);
        self.clients = []
        if USE_GLOBAL_CLIENT:
            # use global client
            self.client = global_client
        else:
            cfb = ConnectionFactoryBuilder()
            self.client = ArcusClient.createArcusClient(arcus_cloud, service_code, cfb)

        print 'Wait for per-thread client to be connected to Arcus cloud (%d seconds)' % DEFAULT_CONNECTION_WAIT
        Thread.currentThread().sleep(DEFAULT_CONNECTION_WAIT * 1000)
        
        self.flush_counter = 0

        self.tests = []
       
        # insert operations
        self.tests.append(Test(1, "KeyValue").wrap(self.KeyValue))
        self.tests.append(Test(2, "Collection_Btree").wrap(self.Collection_Btree))
        self.tests.append(Test(3, "Collection_Set").wrap(self.Collection_Set))
        self.tests.append(Test(4, "Collection_List").wrap(self.Collection_List))
Example #3
0
######################################################
# configurations for Arcus cloud
arcus_cloud = "127.0.0.1:2181"
service_codes = ["test"]
service_code = random.choice(service_codes)

USE_GLOBAL_CLIENT = False  # False=per thread , True=process

DEFAULT_CONNECTION_WAIT = 2  # init waiting
DEFAULT_TIMEOUT = 3000  # Operation default TO
DEFAULT_PREFIX = 'arcustest-'

# create a global client
if USE_GLOBAL_CLIENT:
    global_cfb = ConnectionFactoryBuilder()
    global_client = ArcusClient.createArcusClient(arcus_cloud, service_code,
                                                  global_cfb)

    # wait for the client to be connected to Arcus cloud
    print 'Wait for global client to be connected to Arcus cloud (%d seconds)' % (
        DEFAULT_CONNECTION_WAIT)
    Thread.currentThread().sleep(DEFAULT_CONNECTION_WAIT * 1000)

######################################################
# WORKLOAD FUNCTIONS
######################################################
print 'creating workloads'
KeyLen = 20
ExpireTime = 600  # seconds
chunk_sizes = [
    96, 120, 152, 192, 240, 304, 384, 480, 600, 752, 944, 1184, 1480, 1856,
    2320, 2904, 3632, 4544, 5680, 7104, 8880, 11104, 13880, 17352, 21696,
# configurations for Arcus cloud
arcus_cloud = "localhost:2181"
#service_codes = ["test-01", "test-02", "test-03", "test-04", "test-05", "test-06"]
service_codes = ["test-01"]
service_code = random.choice(service_codes)

USE_GLOBAL_CLIENT = False   # False=per thread , True=process

DEFAULT_CONNECTION_WAIT = 2 # init waiting
DEFAULT_TIMEOUT = 3000      # Operation default TO
DEFAULT_PREFIX = 'arcustest-'

# create a global client
if USE_GLOBAL_CLIENT:
    global_cfb = ConnectionFactoryBuilder()
    global_client = ArcusClient.createArcusClient(arcus_cloud, service_code, global_cfb)

    # wait for the client to be connected to Arcus cloud
    print 'Wait for global client to be connected to Arcus cloud (%d seconds)' % (DEFAULT_CONNECTION_WAIT)
    Thread.currentThread().sleep(DEFAULT_CONNECTION_WAIT * 1000)

######################################################
# WORKLOAD FUNCTIONS
######################################################
print 'creating workloads'
KeyLen = 20
ExpireTime = 600    # seconds
chunk_sizes = [96, 120, 152, 192, 240, 304, 384, 480, 600, 752, 944, 1184, 1480, 1856, 2320, 2904, 3632, 4544, 5680, 7104, 8880, 11104, 13880, 17352, 21696, 27120, 33904, 42384, 52984, 66232, 82792, 103496, 129376, 161720, 202152, 252696, 315872, 394840, 493552, 1048576]
chunk_values = ["Not_a_slab_class"]
for s in chunk_sizes:
    value = "".join([random.choice(string.lowercase) for i in range(int(s*2/3))])