from perfrunner.tests import PerfTest
from perfrunner.workloads.n1ql import INDEX_STATEMENTS


class TuqTest(PerfTest):

    def build_index(self):
        for master in self.cluster_spec.yield_masters():
            for bucket in self.test_config.buckets:
                for index in self.test_config.index_settings.indexes:
                    for stmnt in INDEX_STATEMENTS[index]:
                        host = master.split(':')[0]
                        self.rest.exec_n1ql_stmnt(host, stmnt.format(bucket))

    def run(self):
        self.load()
        self.wait_for_persistence()
        self.compact_bucket()

        self.build_index()

@@ -30,16 +30,32 @@
 PerfTest
+, TargetIterator
 %0Afrom pe
@@ -130,16 +130,299 @@
 Test):%0A%0A
+    def __init__(self, *args, **kwargs):%0A        super(TuqTest, self).__init__(*args, **kwargs)%0A        self.target_iterator = TargetIterator(self.cluster_spec,%0A                                              self.test_config,%0A                                              prefix='')%0A%0A
     def 

use prefix-less keys in TUQ tests