本文整理汇总了Python中perfrunner.helpers.remote.RemoteHelper.restore_data方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteHelper.restore_data方法的具体用法?Python RemoteHelper.restore_data怎么用?Python RemoteHelper.restore_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类perfrunner.helpers.remote.RemoteHelper
的用法示例。
在下文中一共展示了RemoteHelper.restore_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from perfrunner.helpers.remote import RemoteHelper [as 别名]
# 或者: from perfrunner.helpers.remote.RemoteHelper import restore_data [as 别名]
#.........这里部分代码省略.........
return self.check_failover() or failure
def download_certificate(self):
cert = self.rest.get_certificate(self.master_node)
with open(self.ROOT_CERTIFICATE, 'w') as fh:
fh.write(cert)
def check_rebalance(self) -> str:
for master in self.cluster_spec.masters:
if self.rest.is_not_balanced(master):
return 'The cluster is not balanced'
def check_failover(self) -> Optional[str]:
if hasattr(self, 'rebalance_settings'):
if self.rebalance_settings.failover or \
self.rebalance_settings.graceful_failover:
return
for master in self.cluster_spec.masters:
num_failovers = self.rest.get_failover_counter(master)
if num_failovers:
return 'Failover happened {} time(s)'.format(num_failovers)
def check_core_dumps(self) -> str:
dumps_per_host = self.remote.detect_core_dumps()
core_dumps = {
host: dumps for host, dumps in dumps_per_host.items() if dumps
}
if core_dumps:
return pretty_dict(core_dumps)
def restore(self):
logger.info('Restoring data')
self.remote.restore_data(
self.test_config.restore_settings.backup_storage,
self.test_config.restore_settings.backup_repo,
)
def restore_local(self):
logger.info('Restoring data')
local.extract_cb(filename='couchbase.rpm')
local.cbbackupmgr_restore(
master_node=self.master_node,
cluster_spec=self.cluster_spec,
threads=self.test_config.restore_settings.threads,
archive=self.test_config.restore_settings.backup_storage,
repo=self.test_config.restore_settings.backup_repo,
)
def import_data(self):
logger.info('Importing data')
for bucket in self.test_config.buckets:
self.remote.import_data(
self.test_config.restore_settings.import_file, bucket,
)
def compact_bucket(self, wait: bool = True):
for target in self.target_iterator:
self.rest.trigger_bucket_compaction(target.node, target.bucket)
if wait:
for target in self.target_iterator:
self.monitor.monitor_task(target.node, 'bucket_compaction')
def wait_for_persistence(self):
for target in self.target_iterator: