@@ -13,11 +13,8 @@ class N1QLTest(PerfTest):
1313 COLLECTORS = {
1414 'iostat' : False ,
1515 'memory' : False ,
16- 'n1ql_latency' : True ,
16+ 'n1ql_latency' : False ,
1717 'n1ql_stats' : True ,
18- 'secondary_stats' : True ,
19- 'secondary_debugstats' : True ,
20- 'secondary_debugstats_index' : True ,
2118 'ns_server_system' : True
2219 }
2320
@@ -106,7 +103,17 @@ def store_plans(self):
106103 with open ('query_plan_{}.json' .format (i ), 'w' ) as fh :
107104 fh .write (pretty_dict (plan ))
108105
106+ def enable_stats (self ):
107+ if self .index_nodes :
108+ self .COLLECTORS ['secondary_stats' ] = True
109+ if not hasattr (self , 'ALL_BUCKETS' ):
110+ self .COLLECTORS ['secondary_debugstats' ] = True
111+ self .COLLECTORS ['secondary_debugstats_index' ] = True
112+ if "latency" in self .__class__ .__name__ .lower ():
113+ self .COLLECTORS ['n1ql_latency' ] = True
114+
109115 def run (self ):
116+ self .enable_stats ()
110117 self .load ()
111118 self .wait_for_persistence ()
112119 self .check_num_items ()
@@ -174,6 +181,7 @@ def rebalance(self, initial_nodes):
174181 self .worker_manager .abort ()
175182
176183 def run (self ):
184+ self .enable_stats ()
177185 self .load ()
178186 self .wait_for_persistence ()
179187 self .check_num_items ()
@@ -197,9 +205,6 @@ class N1QLThroughputTest(N1QLTest):
197205 'memory' : False ,
198206 'n1ql_latency' : False ,
199207 'n1ql_stats' : True ,
200- 'secondary_stats' : True ,
201- 'secondary_debugstats' : True ,
202- 'secondary_debugstats_index' : True ,
203208 'ns_server_system' : True
204209 }
205210
@@ -268,6 +273,7 @@ def rebalance(self, initial_nodes):
268273 return rebalance_time , total_requests
269274
270275 def run (self ):
276+ self .enable_stats ()
271277 self .load ()
272278 self .wait_for_persistence ()
273279 self .check_num_items ()
@@ -288,6 +294,14 @@ class N1QLJoinTest(N1QLTest):
288294
289295 ALL_BUCKETS = True
290296
297+ COLLECTORS = {
298+ 'iostat' : False ,
299+ 'memory' : False ,
300+ 'n1ql_latency' : False ,
301+ 'n1ql_stats' : True ,
302+ 'ns_server_system' : True
303+ }
304+
291305 def load_regular (self , load_settings , target ):
292306 load_settings .items //= 2
293307 super (N1QLTest , self ).load (settings = load_settings ,
@@ -342,6 +356,7 @@ def access(self, *args):
342356 target_iterator = iterator )
343357
344358 def run (self ):
359+ self .enable_stats ()
345360 self .load ()
346361 self .wait_for_persistence ()
347362
@@ -400,6 +415,7 @@ def _report_kpi(self, time_elapsed):
400415 )
401416
402417 def run (self ):
418+ self .enable_stats ()
403419 self .load ()
404420 self .wait_for_persistence ()
405421 self .check_num_items ()
@@ -442,6 +458,7 @@ def access(self, *args):
442458 PerfTest .access (self , settings = access_settings )
443459
444460 def run (self ):
461+ self .enable_stats ()
445462 self .load ()
446463 self .wait_for_persistence ()
447464 self .check_num_items ()
@@ -476,6 +493,7 @@ def xattr_load(self, *args, **kwargs):
476493 super ().xattr_load (target_iterator = iterator )
477494
478495 def run (self ):
496+ self .enable_stats ()
479497 self .load ()
480498 self .xattr_load ()
481499 self .wait_for_persistence ()
@@ -533,6 +551,7 @@ def rebalance(self, initial_nodes):
533551 self .worker_manager .abort ()
534552
535553 def run (self ):
554+ self .enable_stats ()
536555 self .load ()
537556 self .xattr_load ()
538557 self .wait_for_persistence ()
@@ -555,13 +574,14 @@ class TpcDsTest(N1QLTest):
555574 COLLECTORS = {
556575 'iostat' : False ,
557576 'memory' : False ,
558- 'n1ql_latency' : True ,
577+ 'n1ql_latency' : False ,
559578 'n1ql_stats' : True ,
560579 'net' : False ,
561- 'secondary_debugstats_index' : True ,
580+ 'secondary_debugstats_index' : False ,
562581 }
563582
564583 def run (self ):
584+ self .enable_stats ()
565585 self .load_tpcds_json_data ()
566586
567587 self .create_indexes ()
@@ -589,7 +609,7 @@ class TpcDsIndexTest(TpcDsTest):
589609 COLLECTORS = {
590610 'memory' : False ,
591611 'net' : False ,
592- 'secondary_debugstats_index' : True ,
612+ 'secondary_debugstats_index' : False ,
593613 }
594614
595615 @with_stats
@@ -605,6 +625,7 @@ def _report_kpi(self, indexing_time: float):
605625 )
606626
607627 def run (self ):
628+ self .enable_stats ()
608629 self .load_tpcds_json_data ()
609630
610631 time_elapsed = self .create_indexes ()
@@ -615,13 +636,14 @@ def run(self):
615636class BigFUNLatencyTest (N1QLLatencyTest ):
616637
617638 COLLECTORS = {
618- 'n1ql_latency' : True ,
639+ 'n1ql_latency' : False ,
619640 'n1ql_stats' : True ,
620641 'net' : False ,
621- 'secondary_debugstats_index' : True ,
642+ 'secondary_debugstats_index' : False ,
622643 }
623644
624645 def run (self ):
646+ self .enable_stats ()
625647 self .restore ()
626648 self .wait_for_persistence ()
627649
@@ -636,6 +658,7 @@ def run(self):
636658class N1QLFunctionTest (N1QLTest ):
637659
638660 def run (self ):
661+ self .enable_stats ()
639662 self .load ()
640663 self .wait_for_persistence ()
641664 self .check_num_items ()
0 commit comments