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


Python CollectorStatus.load_latest_status方法代码示例

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


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

示例1: test_persistence_fail

# 需要导入模块: from checks.check_status import CollectorStatus [as 别名]
# 或者: from checks.check_status.CollectorStatus import load_latest_status [as 别名]
def test_persistence_fail():

    # Assert remove doesn't crap out if a file doesn't exist.
    CollectorStatus.remove_latest_status()
    CollectorStatus.remove_latest_status()

    status = CollectorStatus.load_latest_status()
    assert not status
开发者ID:7040210,项目名称:dd-agent,代码行数:10,代码来源:test_check_status.py

示例2: test_persistence

# 需要导入模块: from checks.check_status import CollectorStatus [as 别名]
# 或者: from checks.check_status.CollectorStatus import load_latest_status [as 别名]
def test_persistence():
    i1 = InstanceStatus(1, STATUS_OK)
    chk1 = CheckStatus("dummy", [i1], 1, 2)
    c1 = CollectorStatus([chk1])
    c1.persist()

    c2 = CollectorStatus.load_latest_status()
    nt.assert_equal(1, len(c2.check_statuses))
    chk2 = c2.check_statuses[0]
    assert chk2.name == chk1.name
    assert chk2.status == chk2.status
    assert chk2.metric_count == 1
    assert chk2.event_count == 2
开发者ID:7040210,项目名称:dd-agent,代码行数:15,代码来源:test_check_status.py

示例3: get

# 需要导入模块: from checks.check_status import CollectorStatus [as 别名]
# 或者: from checks.check_status.CollectorStatus import load_latest_status [as 别名]
 def get(self):
     dogstatsd_status = DogstatsdStatus.load_latest_status()
     forwarder_status = ForwarderStatus.load_latest_status()
     collector_status = CollectorStatus.load_latest_status()
     self.render(os.path.join(agent_root, "pup", "status.html"),
         port=port,
         platform=platform.platform(),
         agent_version=get_version(),
         python_version=platform.python_version(),
         logger_info=logger_info(),
         dogstatsd=dogstatsd_status.to_dict(),
         forwarder=forwarder_status.to_dict(),
         collector=collector_status.to_dict(),
     )
开发者ID:bakins,项目名称:dd-agent,代码行数:16,代码来源:pup.py

示例4: latest_status

# 需要导入模块: from checks.check_status import CollectorStatus [as 别名]
# 或者: from checks.check_status.CollectorStatus import load_latest_status [as 别名]
 def latest_status(self):
     try:
         loaded_template = template.Loader(".")
         dogstatsd_status = DogstatsdStatus.load_latest_status()
         forwarder_status = ForwarderStatus.load_latest_status()
         collector_status = CollectorStatus.load_latest_status()
         generated_template = loaded_template.load("status.html").generate(
             port=22,
             platform=platform.platform(),
             agent_version=get_version(),
             python_version=platform.python_version(),
             logger_info=logger_info(),
             dogstatsd=dogstatsd_status.to_dict(),
             forwarder=forwarder_status.to_dict(),
             collector=collector_status.to_dict(),
         )
         return generated_template
     except Exception:
         return "Unable to fetch latest status"
开发者ID:hutchic,项目名称:dd-agent,代码行数:21,代码来源:gui.py


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