def get_stats(self, host, port, bucket, stats): proxy_port = self.test_config.bucket.proxy_port if proxy_port is None: mc = MemcachedClient(host=host, port=port) mc.sasl_auth_plain(user=bucket, password=self.password) else: mc = MemcachedClient(host=host, port=proxy_port) return mc.stats(stats)
def mc_iterator(self): password = self.test_config.bucket.password for host_port in self.cluster_spec.yield_servers(): host = host_port.split(':')[0] memcached_port = self.rest.get_memcached_port(host_port) for bucket in self.test_config.buckets: mc = MemcachedClient(host=host, port=memcached_port) try: mc.sasl_auth_plain(user=bucket, password=password) yield mc except MemcachedError: logger.warn('Auth failure')
def set_flusher_param(self, host, port, bucket, key, value): logger.info('Changing flusher params: {}={}'.format(key, value)) mc = MemcachedClient(host=host, port=port) mc.sasl_auth_plain(user=bucket, password=self.password) mc.set_param(key, value, memcacheConstants.ENGINE_PARAM_FLUSH)