本文整理匯總了Python中moztelemetry.dataset.Dataset._summaries方法的典型用法代碼示例。如果您正苦於以下問題:Python Dataset._summaries方法的具體用法?Python Dataset._summaries怎麽用?Python Dataset._summaries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類moztelemetry.dataset.Dataset
的用法示例。
在下文中一共展示了Dataset._summaries方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_summaries_with_limit
# 需要導入模塊: from moztelemetry.dataset import Dataset [as 別名]
# 或者: from moztelemetry.dataset.Dataset import _summaries [as 別名]
def test_summaries_with_limit():
bucket_name = 'test-bucket'
store = InMemoryStore(bucket_name)
store.store['dir1/subdir1/key1'] = 'value1'
store.store['dir2/subdir2/key2'] = 'value2'
dataset = Dataset(bucket_name, ['dim1', 'dim2'], store=store)
summaries = list(dataset._summaries(1))
assert len(summaries) == 1
assert summaries[0]['key'] in store.store
示例2: test_summaries
# 需要導入模塊: from moztelemetry.dataset import Dataset [as 別名]
# 或者: from moztelemetry.dataset.Dataset import _summaries [as 別名]
def test_summaries():
bucket_name = 'test-bucket'
store = InMemoryStore(bucket_name)
store.store['dir1/subdir1/key1'] = 'value1'
store.store['dir2/subdir2/key2'] = 'value2'
dataset = Dataset(bucket_name, ['dim1', 'dim2'], store=store)
summaries = dataset._summaries()
assert len(list(summaries)) == 2
for item in summaries:
assert item['key'] in store.store
assert item['size'] == len(store.store[item['key']])