def test_num_scan_timeouts(self): index_node = self.get_nodes_from_services_map(service_type="index", get_all_nodes=False) rest = RestConnection(index_node) shell = RemoteMachineShellConnection(self.master) create_index_query = "CREATE INDEX idx ON default(age) USING GSI" try: self.n1ql_helper.run_cbq_query(query=create_index_query, server=self.n1ql_node) except Exception as ex: self.log.info(str(ex)) self.fail( "index creation did not fail with expected error : {0}".format( str(ex))) shell.execute_cbworkloadgen(rest.username, rest.password, 1000000, 70, 'default', 1024, '-j') doc = {"indexer.settings.scan_timeout": 10} rest.set_index_settings(doc) query_params = {'scan_consistency': 'request_plus'} select_query = "SELECT age from default" self.n1ql_helper.run_cbq_query(query=select_query, server=self.n1ql_node, query_params=query_params) index_map = self.get_index_stats() official_stats = rest.get_index_official_stats() self.log.info(index_map) self.log.info(official_stats)
def test_avg_drain_rate(self): index_node = self.get_nodes_from_services_map(service_type="index", get_all_nodes=False) rest = RestConnection(index_node) shell = RemoteMachineShellConnection(self.master) create_index_query = "CREATE INDEX idx ON default(age) USING GSI" try: self.n1ql_helper.run_cbq_query(query=create_index_query, server=self.n1ql_node) except Exception as ex: self.log.info(str(ex)) self.fail( "index creation did not fail with expected error : {0}".format( str(ex))) shell.execute_cbworkloadgen(rest.username, rest.password, 500000, 70, 'default', 1024, '-j') official_stats = rest.get_index_official_stats() index_map = self.get_index_stats() self.log.info(index_map) self.log.info(official_stats) self.assertTrue(index_map['default']['idx']['avg_drain_rate'] == official_stats['default:idx']['avg_drain_rate'])
get_all_nodes=False) rest = RestConnection(index_node) shell = RemoteMachineShellConnection(self.master) create_index_query = "CREATE INDEX idx ON default(age) USING GSI" try: self.n1ql_helper.run_cbq_query(query=create_index_query, server=self.n1ql_node) except Exception, ex: self.log.info(str(ex)) self.fail( "index creation did not fail with expected error : {0}".format( str(ex))) shell.execute_cbworkloadgen(rest.username, rest.password, 1000000, 70,'default', 1024, '-j') doc = {"indexer.settings.scan_timeout": 10} rest.set_index_settings(doc) query_params = {'scan_consistency': 'request_plus'} select_query = "SELECT age from default" self.n1ql_helper.run_cbq_query(query=select_query, server=self.n1ql_node, query_params=query_params) index_map = self.get_index_stats() official_stats = rest.get_index_official_stats() self.log.info(index_map) self.log.info(official_stats) def test_avg_scan_latency(self):