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


Python TimeSeries.pathExpression方法代码示例

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


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

示例1: test_null_zero_sum

# 需要导入模块: from graphite_api.render.datalib import TimeSeries [as 别名]
# 或者: from graphite_api.render.datalib.TimeSeries import pathExpression [as 别名]
    def test_null_zero_sum(self):
        s = TimeSeries("s", 0, 1, 1, [None])
        s.pathExpression = 's'
        [series] = functions.sumSeries({}, [s])
        self.assertEqual(list(series), [None])

        s = TimeSeries("s", 0, 1, 1, [None, 1])
        s.pathExpression = 's'
        t = TimeSeries("s", 0, 1, 1, [None, None])
        t.pathExpression = 't'
        [series] = functions.sumSeries({}, [s, t])
        self.assertEqual(list(series), [None, 1])
开发者ID:robochat,项目名称:graphite-api,代码行数:14,代码来源:test_functions.py

示例2: test_holt_winters

# 需要导入模块: from graphite_api.render.datalib import TimeSeries [as 别名]
# 或者: from graphite_api.render.datalib.TimeSeries import pathExpression [as 别名]
    def test_holt_winters(self):
        timespan = 3600 * 24 * 8  # 8 days
        stop = int(time.time())
        step = 100
        series = TimeSeries('foo.bar',
                            stop - timespan,
                            stop,
                            step,
                            [x**1.5 for x in range(0, timespan, step)])
        series[10] = None
        series.pathExpression = 'foo.bar'
        self.write_series(series, [(100, timespan)])

        ctx = {
            'startTime': parseATTime('-1d'),
        }
        analysis = functions.holtWintersForecast(ctx, [series])
        self.assertEqual(len(analysis), 1)

        analysis = functions.holtWintersConfidenceBands(ctx, [series])
        self.assertEqual(len(analysis), 2)

        analysis = functions.holtWintersConfidenceArea(ctx, [series])
        self.assertEqual(len(analysis), 2)

        analysis = functions.holtWintersAberration(ctx, [series])
        self.assertEqual(len(analysis), 1)
开发者ID:robochat,项目名称:graphite-api,代码行数:29,代码来源:test_functions.py

示例3: _generate_series_list

# 需要导入模块: from graphite_api.render.datalib import TimeSeries [as 别名]
# 或者: from graphite_api.render.datalib.TimeSeries import pathExpression [as 别名]
    def _generate_series_list(self):
        seriesList = []
        config = [range(101), range(101), [1] + [None] * 100]

        for i, c in enumerate(config):
            name = "collectd.test-db{0}.load.value".format(i + 1)
            series = TimeSeries(name, 0, 101, 1, c)
            series.pathExpression = name
            seriesList.append(series)
        return seriesList
开发者ID:icecrime,项目名称:graphite-api,代码行数:12,代码来源:test_functions.py

示例4: _generate_series_list

# 需要导入模块: from graphite_api.render.datalib import TimeSeries [as 别名]
# 或者: from graphite_api.render.datalib.TimeSeries import pathExpression [as 别名]
    def _generate_series_list(self, config=(range(101), range(2, 103), [1] * 2 + [None] * 90 + [1] * 2 + [None] * 7)):
        seriesList = []

        now = int(time.time())

        for i, c in enumerate(config):
            name = "collectd.test-db{0}.load.value".format(i + 1)
            series = TimeSeries(name, now - 101, now, 1, c)
            series.pathExpression = name
            seriesList.append(series)
        return seriesList
开发者ID:heliodor,项目名称:graphite-api,代码行数:13,代码来源:test_functions.py

示例5: test_time_stack

# 需要导入模块: from graphite_api.render.datalib import TimeSeries [as 别名]
# 或者: from graphite_api.render.datalib.TimeSeries import pathExpression [as 别名]
    def test_time_stack(self):
        timespan = 3600 * 24 * 8  # 8 days
        stop = int(time.time())
        step = 100
        series = TimeSeries("foo.bar", stop - timespan, stop, step, [x ** 1.5 for x in range(0, timespan, step)])
        series[10] = None
        series.pathExpression = "foo.bar"
        self.write_series(series, [(100, timespan)])

        ctx = {"startTime": parseATTime("-1d"), "endTime": parseATTime("now")}
        stack = functions.timeStack(ctx, [series], "1d", 0, 7)
        self.assertEqual(len(stack), 7)

        stack = functions.timeStack(ctx, [series], "-1d", 0, 7)
        self.assertEqual(len(stack), 7)
开发者ID:heliodor,项目名称:graphite-api,代码行数:17,代码来源:test_functions.py

示例6: test_time_stack

# 需要导入模块: from graphite_api.render.datalib import TimeSeries [as 别名]
# 或者: from graphite_api.render.datalib.TimeSeries import pathExpression [as 别名]
    def test_time_stack(self):
        timespan = 3600 * 24 * 8  # 8 days
        stop = int(time.time())
        step = 100
        series = TimeSeries('foo.bar',
                            stop - timespan,
                            stop,
                            step,
                            [x**1.5 for x in range(0, timespan, step)])
        series[10] = None
        series.pathExpression = 'foo.bar'
        self.write_series(series, [(100, timespan)])

        ctx = {'startTime': parseATTime('-1d'),
               'endTime': parseATTime('now')}
        stack = functions.timeStack(ctx, [series], '1d', 0, 7)
        self.assertEqual(len(stack), 7)

        stack = functions.timeStack(ctx, [series], '-1d', 0, 7)
        self.assertEqual(len(stack), 7)
开发者ID:robochat,项目名称:graphite-api,代码行数:22,代码来源:test_functions.py


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