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


Python views.start_kpi_tracking函数代码示例

本文整理汇总了Python中stacktach.views.start_kpi_tracking函数的典型用法代码示例。如果您正苦于以下问题:Python start_kpi_tracking函数的具体用法?Python start_kpi_tracking怎么用?Python start_kpi_tracking使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: test_start_kpi_tracking_not_from_api

 def test_start_kpi_tracking_not_from_api(self):
     raw = self.mox.CreateMockAnything()
     raw.event = 'compute.instance.update'
     raw.service = 'compute'
     self.mox.ReplayAll()
     views.start_kpi_tracking(None, raw)
     self.mox.VerifyAll()
开发者ID:pperezrubio,项目名称:stacktach,代码行数:7,代码来源:test_stacktach.py

示例2: test_start_kpi_tracking_not_using_host

 def test_start_kpi_tracking_not_using_host(self):
     lifecycle = self.mox.CreateMockAnything()
     tracker = self.mox.CreateMockAnything()
     when = utils.decimal_utc()
     raw = utils.create_raw(self.mox, when, 'compute.instance.update',
                            host='api.example.com', service='compute')
     self.mox.ReplayAll()
     views.start_kpi_tracking(lifecycle, raw)
     self.mox.VerifyAll()
开发者ID:pperezrubio,项目名称:stacktach,代码行数:9,代码来源:test_stacktach.py

示例3: test_start_kpi_tracking

 def test_start_kpi_tracking(self):
     lifecycle = self.mox.CreateMockAnything()
     tracker = self.mox.CreateMockAnything()
     when = utils.decimal_utc()
     raw = utils.create_raw(self.mox, when, 'compute.instance.update',
                            host='nova.example.com', service='api')
     views.STACKDB.create_request_tracker(lifecycle=lifecycle,
                                          request_id=REQUEST_ID_1,
                                          start=when,
                                          last_timing=None,
                                          duration=str(0.0))\
                                          .AndReturn(tracker)
     views.STACKDB.save(tracker)
     self.mox.ReplayAll()
     views.start_kpi_tracking(lifecycle, raw)
     self.mox.VerifyAll()
开发者ID:pperezrubio,项目名称:stacktach,代码行数:16,代码来源:test_stacktach.py

示例4: test_aggregate_lifecycle_update

    def test_aggregate_lifecycle_update(self):
        event = 'compute.instance.update'
        when = datetime.datetime.utcnow()
        raw = utils.create_raw(self.mox, when, event, old_task='reboot')

        views.STACKDB.find_lifecycles(instance=INSTANCE_ID_1).AndReturn([])
        lifecycle = self.mox.CreateMockAnything()
        lifecycle.instance = INSTANCE_ID_1
        views.STACKDB.create_lifecycle(instance=INSTANCE_ID_1).AndReturn(lifecycle)
        views.STACKDB.save(lifecycle)

        self.mox.StubOutWithMock(views, "start_kpi_tracking")
        views.start_kpi_tracking(lifecycle, raw)

        self.mox.ReplayAll()
        views.aggregate_lifecycle(raw)
        self.assertEqual(lifecycle.last_raw, raw)
        self.assertEqual(lifecycle.last_state, 'active')
        self.assertEqual(lifecycle.last_task_state, 'reboot')

        self.mox.VerifyAll()
开发者ID:pperezrubio,项目名称:stacktach,代码行数:21,代码来源:test_stacktach.py

示例5: test_start_kpi_tracking_not_update

 def test_start_kpi_tracking_not_update(self):
     raw = self.mox.CreateMockAnything()
     raw.event = 'compute.instance.create.start'
     self.mox.ReplayAll()
     views.start_kpi_tracking(None, raw)
     self.mox.VerifyAll()
开发者ID:pperezrubio,项目名称:stacktach,代码行数:6,代码来源:test_stacktach.py


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