Exemplo n.º 1
0
 def reset_utilzation_stats(self):
     for target in self.test.target_iterator:
         logger.info('Resetting utilization stats from {}/{}'.format(
                     target.node, target.bucket))
         cb = CouchbaseClient(target.node, target.bucket,
                              self.rest_username, self.rest_password)
         cb.reset_utilization_stats()
Exemplo n.º 2
0
    def rebalance(self):
        """Trigger cluster rebalance (in, out, swap) after 1 hour. Stop the
        test once rebalance completed (with 1 hour delay).
        """
        if not self.parami('access_phase', 0):
            return
        else:
            self.log.info("started rebalance thread")

        time.sleep(self.parami("rebalance_after", 3600))

        server = "{0}:{1}".format(self.input.servers[0].ip,
                                  self.input.servers[0].port)
        bucket = self.params("bucket", "default")
        cb = CouchbaseClient(server, bucket)
        cb.reset_utilization_stats()

        self.delayed_rebalance(
            num_nodes=self.parami("num_nodes_after",
                                  PerfDefaults.num_nodes_after),
            delay_seconds=1,
            max_retries=self.parami("reb_max_retries",
                                    PerfDefaults.reb_max_retries),
            reb_mode=self.parami("reb_mode", PerfDefaults.reb_mode),
            sync=True)

        reporter = StatsReporter(cb)
        reporter.report_stats("util_stats")

        time.sleep(self.parami("shutdown_after", 3600))
        self.log.info("trigerring shutdown event")
        self.shutdown_event.set()