def gen_command(self, start_phase): """Generate command based on its attributes.""" # Add command cmd_list = [self.resolve_program()] cmd_list.append(self.mongos.host_str()) cmd_list.append('./base_remote_resources/scripts/%s' % self.script_name) opt = self.options global _stats_server if _stats_server != None: opt['statsServer'] = _stats_server.host_str() eval_cmd = 'inlineOptions = %s;' % json.dumps(opt) cmd_list.append('--eval %s' % console.escape(eval_cmd)) if _stats_server != None: _stats_server.add_server_client(self.proc_mgr) cmd_list = _stats_server.cmd_with_syslog(self.proc_mgr, '%s.mongo' % self.alias, cmd_list) cmd = ' '.join(cmd_list) self.last_phase = start_phase AddCommandToProcMgr(self.proc_mgr, cmd, self.alias, start_phase)
def gen_command(self, start_phase): """Generate command based on its attributes.""" # Enable sharding after mongos starts. AddPhaseChecker(self._enable_sharding, self.mongos.last_phase) # Add command cmd_list = [self.program] cmd_list.append(self.mongos.host_str()) cmd_list.append('load-test-actions.js') opt = { 'scriptMode' : 'load', 'shardedColls' : self.sharded_collection, 'maxLoadSleep' : self.max_load_sleep } eval_cmd = 'inlineOptions = %s;' % json.dumps(opt) cmd_list.append('--eval %s' % console.escape(eval_cmd)) cmd = ' '.join(cmd_list) AddCommandToProcMgr(self.proc_mgr, cmd, self.alias, start_phase)
def gen_command(self, start_phase): """Generate command based on its attributes.""" # Enable sharding after mongos starts. AddPhaseChecker(self._enable_sharding, self.mongos.last_phase) # Add command cmd_list = [self.program] cmd_list.append(self.mongos.host_str()) cmd_list.append('load-test-actions.js') opt = { 'scriptMode': 'load', 'shardedColls': self.sharded_collection, 'maxLoadSleep': self.max_load_sleep } eval_cmd = 'inlineOptions = %s;' % json.dumps(opt) cmd_list.append('--eval %s' % console.escape(eval_cmd)) cmd = ' '.join(cmd_list) AddCommandToProcMgr(self.proc_mgr, cmd, self.alias, start_phase)