def setUp(self): self.stats = kv.KVStats() self.simulator = pegasus.simulator.Simulator(self.stats) rack = pegasus.node.Rack(0) # Single client node and 4 cache nodes all in one rack self.client_node = pegasus.node.Node(rack, 0) self.cache_nodes = [] for i in range(4): self.cache_nodes.append(pegasus.node.Node(rack, i+1)) config = self.StaticConfig(self.cache_nodes, None, memcachekv.WriteMode.UPDATE) # Register applications self.client_app = memcachekv.MemcacheKVClient(self.SimpleGenerator(), self.stats) self.client_app.register_config(config) self.client_node.register_app(self.client_app) self.simulator.register_config(config) self.server_apps = [] for node in self.cache_nodes: app = memcachekv.MemcacheKVServer(None, self.stats) app.register_config(config) node.register_app(app) self.server_apps.append(app) self.simulator.add_node(self.client_node) self.simulator.add_nodes(self.cache_nodes)
def setUp(self): # 1 client node and four cache nodes in the same rack rack = pegasus.node.Rack() self.cache_nodes = [] self.server_apps = [] self.stats = kv.KVStats() for i in range(self.N_CACHE_NODES): self.cache_nodes.append(pegasus.node.Node(parent = rack, id = i)) self.client_node = pegasus.node.Node(parent = rack, id = self.N_CACHE_NODES) # Single directory config with cache node 0 as the directory self.config = TestConfig(cache_nodes = self.cache_nodes, db_node = None, dir_node_id = 0) # Register apps self.client_app = pegasuskv.PegasusKVClient(generator = None, stats = self.stats) self.client_app.register_config(self.config) self.client_node.register_app(self.client_app) for node in self.cache_nodes: server_app = pegasuskv.PegasusKVServer(generator = None, stats = self.stats) server_app.register_config(self.config) node.register_app(server_app) self.server_apps.append(server_app)
def setUp(self): rack = pegasus.node.Rack() self.client = pegasus.node.Node(rack, 0) self.server = pegasus.node.Node(rack, 1) self.stats = kv.KVStats() config = self.SingleServerConfig([self.server], None, memcachekv.WriteMode.UPDATE) self.client_app = memcachekv.MemcacheKVClient(None, self.stats) self.client_app.register_config(config) self.server_app = memcachekv.MemcacheKVServer(None, self.stats) self.server_app.register_config(config) self.client.register_app(self.client_app) self.server.register_app(self.server_app)
def setUp(self): rack = pegasus.node.Rack(0) self.cache_nodes = [] self.server_apps = [] for i in range(4): self.cache_nodes.append(pegasus.node.Node(rack, i)) self.config = self.TestConfig(self.cache_nodes, None, memcachekv.WriteMode.UPDATE, 1.5, 16) for node in self.cache_nodes: app = memcachekv.MemcacheKVServer(None, None) app.register_config(self.config) node.register_app(app) self.server_apps.append(app) self.client_node = pegasus.node.Node(rack, 4) self.stats = kv.KVStats() self.client_app = memcachekv.MemcacheKVClient(None, self.stats) self.client_app.register_config(self.config) self.client_node.register_app(self.client_app)
def setUp(self): rack = pegasus.node.Rack() self.servers = [] self.server_apps = [] for i in range(4): self.servers.append(pegasus.node.Node(rack, i)) self.client = pegasus.node.Node(rack, 4) self.stats = kv.KVStats() self.config = self.TestConfig(self.servers, None, memcachekv.WriteMode.UPDATE) self.client_app = memcachekv.MemcacheKVClient(None, self.stats) self.client_app.register_config(self.config) self.client.register_app(self.client_app) for server in self.servers: app = memcachekv.MemcacheKVServer(None, self.stats) app.register_config(self.config) self.server_apps.append(app) server.register_app(app)
def setUp(self): self.kvapp = memcachekv.MemcacheKVServer(None, kv.KVStats())
# Initialize simulator if args.keytype == 'unif': key_type = KeyType.UNIFORM elif args.keytype == 'zipf': key_type = KeyType.ZIPF if args.intervaltype == 'unif': interval_type = IntervalType.UNIFORM elif args.intervaltype == 'poiss': interval_type = IntervalType.POISS generator = WorkloadGenerator(keys, args.values, args.gets, args.puts, key_type, interval_type, args.interval, args.alpha, args.initkey) stats = kv.KVStats(args.epoch * 1000) simulator = pegasus.simulator.Simulator(stats, args.progress) rack = pegasus.node.Rack() client_node = pegasus.node.Node( parent=rack, id=args.nodes, logical_client=True) # use a single logical client node cache_nodes = [] for i in range(args.nodes): cache_nodes.append( pegasus.node.Node(parent=rack, id=i, nprocs=args.procs, drop_tail=True)) # Register applications if args.app == 'memcache':