github.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:flash_services 作者: textbook 项目源码 文件源码
def health_summary(self, half_life):
        """Calculate the health of the service.

        Args:
          half_life (:py:class:`datetime.timedelta`): The half life of
            the service's issues.

        Returns:
          :py:class:`str`: The health of the service, either ``'ok'``,
            ``'neutral'`` or ``'error'``.

        """
        if half_life is None:
            return 'neutral'
        if half_life <= timedelta(days=self.ok_threshold):
            return 'ok'
        elif half_life <= timedelta(days=self.neutral_threshold):
            return 'neutral'
        return 'error'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号