当前位置: 首页>>代码示例>>Python>>正文


Python RestConnection.set_view_info方法代码示例

本文整理汇总了Python中membase.api.rest_client.RestConnection.set_view_info方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.set_view_info方法的具体用法?Python RestConnection.set_view_info怎么用?Python RestConnection.set_view_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在membase.api.rest_client.RestConnection的用法示例。


在下文中一共展示了RestConnection.set_view_info方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_compaction_details

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import set_view_info [as 别名]
 def _get_compaction_details(self):
     rest = RestConnection(self.server)
     status, content = rest.set_view_info(self.bucket, self.design_doc_name)
     curr_no_of_compactions = content["stats"]["compactions"]
     curr_ddoc_fragemtation = \
         MonitorViewFragmentationTask.calc_ddoc_fragmentation(rest, self.design_doc_name, self.bucket)
     return (curr_no_of_compactions, curr_ddoc_fragemtation)
开发者ID:jchris,项目名称:testrunner,代码行数:9,代码来源:task.py

示例2: test_views_time_compaction

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import set_view_info [as 别名]
 def test_views_time_compaction(self):
     rest = RestConnection(self.master)
     currTime = datetime.datetime.now()
     fromTime = currTime + datetime.timedelta(hours=1)
     toTime = currTime + datetime.timedelta(hours=12)
     self.set_auto_compaction(rest, viewFragmntThresholdPercentage=self.fragmentation_value, allowedTimePeriodFromHour=fromTime.hour,
                              allowedTimePeriodFromMin=fromTime.minute, allowedTimePeriodToHour=toTime.hour, allowedTimePeriodToMin=toTime.minute,
                              allowedTimePeriodAbort="false")
     self.make_ddocs(self.ddocs_num, self.view_per_ddoc)
     self.create_ddocs()
     self._load_all_buckets(self.master, self.gen_load, "create", 0)
     self._monitor_view_fragmentation()
     currTime = datetime.datetime.now()
     #Need to make it configurable
     newTime = currTime + datetime.timedelta(minutes=5)
     self.set_auto_compaction(rest, viewFragmntThresholdPercentage=self.fragmentation_value, allowedTimePeriodFromHour=currTime.hour,
                               allowedTimePeriodFromMin=currTime.minute, allowedTimePeriodToHour=newTime.hour, allowedTimePeriodToMin=newTime.minute,
                               allowedTimePeriodAbort="false")
     for ddoc in self.ddocs:
         status, content = rest.set_view_info(self.default_bucket_name, ddoc.name)
         curr_no_of_compactions = content["stats"]["compactions"]
         self.log.info("Current number of compactions is {0}".format(curr_no_of_compactions))
     compaction_tasks = []
     for ddoc in self.ddocs:
         compaction_tasks.append(self.cluster.async_monitor_compact_view(self.master, ddoc.name, frag_value=self.fragmentation_value))
     for task in compaction_tasks:
         task.result()
开发者ID:EricACooper,项目名称:testrunner,代码行数:29,代码来源:compactionviewtests.py

示例3: aggregate_ddoc_info

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import set_view_info [as 别名]
    def aggregate_ddoc_info(rest, design_doc_name, bucket = "default"):

        nodes = rest.node_statuses()
        info = []
        for node in nodes:
            server_info = {"ip" : node.ip,
                           "port" : node.port,
                           "username" : rest.username,
                           "password" : rest.password}
            rest = RestConnection(server_info)
            status, content = rest.set_view_info(bucket, design_doc_name)
            if status:
                info.append(content)

        return info
开发者ID:jchris,项目名称:testrunner,代码行数:17,代码来源:task.py

示例4: collect_indexing_stats

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import set_view_info [as 别名]
    def collect_indexing_stats(self, nodes, bucket, ddoc, frequency):
        """Collect view indexing stats"""
        self._task['view_info'] = list()

        while not self._aborted():
            time.sleep(frequency)
            print "Collecting view indexing stats"
            for node in nodes:
                rest = RestConnection(node)
                data = rest.set_view_info(bucket, ddoc)
                update_history = data[1]['stats']['update_history']
                try:
                    indexing_time = \
                        [event['indexing_time'] for event in update_history]
                    avg_time = sum(indexing_time) / len(indexing_time)
                except (IndexError, KeyError):
                    avg_time = 0
                finally:
                    self._task['view_info'].append({'node': node.ip,
                                                    'indexing_time': avg_time,
                                                    'timestamp': time.time()})

        print "Finished collecting view indexing stats"
开发者ID:IrynaMironava,项目名称:testrunner,代码行数:25,代码来源:stats.py

示例5: _is_compacting

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import set_view_info [as 别名]
 def _is_compacting(self):
     rest = RestConnection(self.server)
     status, content = rest.set_view_info(self.bucket, self.design_doc_name)
     return content["compact_running"] == "true"
开发者ID:jchris,项目名称:testrunner,代码行数:6,代码来源:task.py


注:本文中的membase.api.rest_client.RestConnection.set_view_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。