本文整理匯總了Python中graphite_api.render.datalib.TimeSeries.consolidate方法的典型用法代碼示例。如果您正苦於以下問題:Python TimeSeries.consolidate方法的具體用法?Python TimeSeries.consolidate怎麽用?Python TimeSeries.consolidate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類graphite_api.render.datalib.TimeSeries
的用法示例。
在下文中一共展示了TimeSeries.consolidate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_TimeSeries_consolidate
# 需要導入模塊: from graphite_api.render.datalib import TimeSeries [as 別名]
# 或者: from graphite_api.render.datalib.TimeSeries import consolidate [as 別名]
def test_TimeSeries_consolidate(self):
values = range(0, 100)
series = TimeSeries("collectd.test-db.load.value",
0, len(values)/2, 1, values)
self.assertEqual(series.valuesPerPoint, 1)
series.consolidate(2)
self.assertEqual(series.valuesPerPoint, 2)
示例2: test_TimeSeries_iterate_valuesPerPoint_2_invalid
# 需要導入模塊: from graphite_api.render.datalib import TimeSeries [as 別名]
# 或者: from graphite_api.render.datalib.TimeSeries import consolidate [as 別名]
def test_TimeSeries_iterate_valuesPerPoint_2_invalid(self):
values = range(0, 100)
series = TimeSeries("collectd.test-db.load.value",
0, 5, 1, values, consolidate='bogus')
self.assertEqual(series.valuesPerPoint, 1)
series.consolidate(2)
self.assertEqual(series.valuesPerPoint, 2)
with self.assertRaises(Exception):
list(series)
示例3: test_TimeSeries_iterate_valuesPerPoint_2_min
# 需要導入模塊: from graphite_api.render.datalib import TimeSeries [as 別名]
# 或者: from graphite_api.render.datalib.TimeSeries import consolidate [as 別名]
def test_TimeSeries_iterate_valuesPerPoint_2_min(self):
values = range(0, 100)
series = TimeSeries("collectd.test-db.load.value",
0, 5, 1, values, consolidate='min')
self.assertEqual(series.valuesPerPoint, 1)
series.consolidate(2)
self.assertEqual(series.valuesPerPoint, 2)
expected = TimeSeries("collectd.test-db.load.value",
0, 5, 1, list(range(0, 100, 2)) + [None])
self.assertEqual(list(series), list(expected))
示例4: test_TimeSeries_iterate_valuesPerPoint_2_none_values
# 需要導入模塊: from graphite_api.render.datalib import TimeSeries [as 別名]
# 或者: from graphite_api.render.datalib.TimeSeries import consolidate [as 別名]
def test_TimeSeries_iterate_valuesPerPoint_2_none_values(self):
values = [None, None, None, None, None]
series = TimeSeries("collectd.test-db.load.value",
0, len(values)/2, 1, values)
self.assertEqual(series.valuesPerPoint, 1)
series.consolidate(2)
self.assertEqual(series.valuesPerPoint, 2)
expected = TimeSeries("collectd.test-db.load.value",
0, 5, 1, [None, None, None])
self.assertEqual(list(series), list(expected))
示例5: test_TimeSeries_iterate_valuesPerPoint_2_avg
# 需要導入模塊: from graphite_api.render.datalib import TimeSeries [as 別名]
# 或者: from graphite_api.render.datalib.TimeSeries import consolidate [as 別名]
def test_TimeSeries_iterate_valuesPerPoint_2_avg(self):
values = range(0, 100)
series = TimeSeries("collectd.test-db.load.value",
0, len(values)/2, 1, values)
self.assertEqual(series.valuesPerPoint, 1)
series.consolidate(2)
self.assertEqual(series.valuesPerPoint, 2)
expected = TimeSeries("collectd.test-db.load.value", 0, 5, 1,
list(map(lambda x: x+0.5, range(0, 100, 2))) +
[None])
self.assertEqual(list(series), list(expected))