Skip to content

Instantly share code, notes, and snippets.

View mengzhangjian's full-sized avatar

Richard-zhang mengzhangjian

View GitHub Profile
@mengzhangjian
mengzhangjian / web_test.py
Created May 20, 2019 13:16 — forked from klb3713/web_test.py
用Python实现的Web服务器的压力测试脚本
# -*- coding: utf-8 -*-
__author__ = 'klb3713'
import threading, time, httplib
HOST = "127.0.0.1"; #主机地址 例如192.168.1.101
PORT = 8001 #端口
URI = "/api/huohuaId2Url" #相对地址,加参数防止缓存,否则可能会返回304
TOTAL = 0 #总数
SUCC = 0 #响应成功数
FAIL = 0 #响应失败数