本文整理汇总了Python中checks.check_status.ForwarderStatus.load_latest_status方法的典型用法代码示例。如果您正苦于以下问题:Python ForwarderStatus.load_latest_status方法的具体用法?Python ForwarderStatus.load_latest_status怎么用?Python ForwarderStatus.load_latest_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类checks.check_status.ForwarderStatus
的用法示例。
在下文中一共展示了ForwarderStatus.load_latest_status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from checks.check_status import ForwarderStatus [as 别名]
# 或者: from checks.check_status.ForwarderStatus 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(),
)
示例2: latest_status
# 需要导入模块: from checks.check_status import ForwarderStatus [as 别名]
# 或者: from checks.check_status.ForwarderStatus 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"