本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.get_active_key_count方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.get_active_key_count方法的具体用法?Python RestConnection.get_active_key_count怎么用?Python RestConnection.get_active_key_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.get_active_key_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_maxttl_with_doc_updates
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import get_active_key_count [as 别名]
def test_maxttl_with_doc_updates(self):
"""
1. Create a bucket with ttl = 60s
2. Upload 1000 docs with exp = 40s
3. After 20s, Update docs with exp = 60s
4. After 40s, run expiry pager again and get item count, must be 1000
5. After 20s, run expiry pager again and get item count, must be 0
"""
rest = RestConnection(self.master)
for bucket in self.buckets:
self._load_json(bucket, self.num_items, exp=40)
self.sleep(20, "waiting to update docs with exp=60s...")
for bucket in self.buckets:
self._load_json(bucket, self.num_items, exp=60)
self.sleep(40, "waiting before running expiry pager...")
self.expire_pager(self.servers)
for bucket in self.buckets:
items = rest.get_active_key_count(bucket)
self.log.info("Items: {0}".format(items))
if items != self.num_items:
self.fail("FAIL: Docs with updated expiry deleted unexpectedly!")
self.sleep(20, "waiting before running expiry pager...")
self.expire_pager(self.servers)
self.sleep(20, "waiting for item count to come down...")
for bucket in self.buckets:
items = rest.get_active_key_count(bucket)
self.log.info("Items: {0}".format(items))
if items != 0:
self.fail("FAIL: Docs with updated expiry not deleted after new exp has elapsed!")