本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.set_global_loglevel方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.set_global_loglevel方法的具体用法?Python RestConnection.set_global_loglevel怎么用?Python RestConnection.set_global_loglevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.set_global_loglevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PerfBase
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import set_global_loglevel [as 别名]
#.........这里部分代码省略.........
status = self.rest_helper.bucket_exists(bucket)
self.assertTrue(status,
msg='unable to create {0} bucket'.format(bucket))
def reconfigure(self):
"""Customize basic Couchbase setup"""
self.log.info("customizing setup")
self.set_loglevel()
self.customize_xdcr_settings()
self.set_autocompaction()
self.set_exp_pager_stime()
self.set_rebalance_options()
def set_rebalance_options(self):
# rebalanceMovesBeforeCompaction
rmbc = self.parami('rebalance_moves_before_compaction', 0)
if rmbc:
cmd = 'ns_config:set(rebalance_moves_before_compaction, {0}).'\
.format(rmbc)
self.rest.diag_eval(cmd)
def set_exp_pager_stime(self):
exp_pager_stime = self.param('exp_pager_stime',
PerfDefaults.exp_pager_stime)
if exp_pager_stime != PerfDefaults.exp_pager_stime:
self.set_ep_param('flush_param', 'exp_pager_stime', exp_pager_stime)
def set_loglevel(self):
"""Set custom loglevel"""
loglevel = self.param('loglevel', None)
if loglevel:
self.rest.set_global_loglevel(loglevel)
def set_mc_threads(self, node, mc_threads):
"""Change number of memcached threads"""
rest = RestConnection(node)
rest.set_mc_threads(mc_threads)
self.log.info("num of memcached threads = {0}".format(mc_threads))
def customize_xdcr_settings(self):
"""Set custom XDCR environment variables"""
max_concurrent_reps_per_doc = self.param('max_concurrent_reps_per_doc',
None)
xdcr_doc_batch_size_kb = self.param('xdcr_doc_batch_size_kb', None)
xdcr_checkpoint_interval = self.param('xdcr_checkpoint_interval', None)
if max_concurrent_reps_per_doc:
env_var = 'MAX_CONCURRENT_REPS_PER_DOC'
value = max_concurrent_reps_per_doc
elif xdcr_doc_batch_size_kb:
env_var = 'XDCR_DOC_BATCH_SIZE_KB'
value = xdcr_doc_batch_size_kb
elif xdcr_checkpoint_interval:
env_var = 'XDCR_CHECKPOINT_INTERVAL'
value = xdcr_checkpoint_interval
else:
return
self.log.info("changing {0} to {1}".format(env_var, value))
for server in self.input.servers:
rc = RemoteMachineShellConnection(server)
rc.set_environment_variable(env_var, value)