perf.py 文件源码

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

项目:isar 作者: ilbers 项目源码 文件源码
def url_info(self, full_url):
    client = Client()
    info = []
    try:
        resp = client.get(full_url, follow = True)
    except Exception as e_status_code:
            self.error('Url: %s, error: %s' % (full_url, e_status_code))
            resp = type('object', (), {'status_code':0, 'content': str(e_status_code)})
    status_code = resp.status_code
    info.append(status_code)
    try:
        req = requests.get(full_url)
    except Exception as e_load_time:
            self.error('Url: %s, error: %s' % (full_url, e_load_time))
    load_time = req.elapsed
    info.append(load_time)
    return info
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号