swift-recon.py 文件源码

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

项目:ansible-optools 作者: jonjozwiak 项目源码 文件源码
def stat_regexp_generator(data):
    """Generate a regeular expression that will swift-recon stats.

    Lines printed by swift-recon look like::

        [data] low: 0, high: 0, avg: 0.0, total: 0, Failed: 0.0%, no_result: 0, reported: 0

    Where data above is the value of the ``data`` parameter passed to the
    function.
    """
    expression = """\s+low:\s+(?P<low>\d+),     # parse out the low result
                    \s+high:\s+(?P<high>\d+),   # parse out the high result
                    \s+avg:\s+(?P<avg>\d+.\d+), # you get the idea now
                    \s+total:\s+(?P<total>\d+),
                    \s+Failed:\s+(?P<failed>\d+.\d+%),
                    \s+no_result:\s+(?P<no_result>\d+),
                    \s+reported:\s+(?P<reported>\d+)"""
    return re.compile('\[' + data + '\]' + expression, re.VERBOSE)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号