__init__.py 文件源码

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

项目:cloud-monitoring 作者: hep-gc 项目源码 文件源码
def date_range():
    """Ensure the requested date range is in a format Graphite will accept.
    """

    range_from = request.values.get('from', '-1h')
    range_end  = request.values.get('end', 'now')

    try:
        # Try to coerce date range into integers
        range_from = int(float(range_from) / 1000)
        range_end  = int(float(range_end) / 1000)
    except:
        # ... or pass string directly to Graphite
        pass

    return (range_from, range_end)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号