1#!/usr/bin/env python2.6
2
3import time
4import json
5
6import load_runner
7
8class ServerInfo(object):
9    def __init__(self, ip):
10        self.ip = ip
11
12
13def default(o):
14    if isinstance(o, ServerInfo):
15        return o.__dict__
16    else:
17        return json.JSONEncoder.default(o)
18
19
20load_info = {
21    'server_info' : [
22        ServerInfo("127.0.0.1"),
23#        ServerInfo("10.80.122.208"),
24#        ServerInfo("10.77.21.230"),
25#        ServerInfo("10.83.25.146"),
26    ],
27    'memcached_info' : {
28        'bucket_name':"",
29        'bucket_port':"11211",
30        'bucket_password':"",
31    },
32    'operation_info' : {
33        'operation_distribution':{'set':3, 'get':5},
34        'valuesize_distribution':{250:30, 1500:5, 20:5},
35        'create_percent':25,
36        'threads':8,
37    },
38    'limit_info' : {
39        'max_items':0,
40        'operation_count':0,
41        'time':10,
42        'max_size':0,
43    },
44}
45
46load = load_runner.LoadRunner(load_info, dryrun=False)
47
48load.start()
49time.sleep(60)
50load.stop()
51load.wait()
52