cherrypy.test.benchmark模块

Cherrypy基准工具

用途:

benchmark.py [选项]

--空:使用空请求对象(仅用于测试HTTP服务器)——注意:启动服务器,但不运行测试;这允许

使用浏览器检查测试页

--帮助:显示此帮助消息--cpmodpy:在54583上通过apache运行测试(使用内置的cpmodpy)--modpython:在54583上通过apache运行测试(使用modpython-gateway)--ab=path:在“path”上使用ab脚本/可执行文件(参见下面)--apache=path:在“path”上使用apache脚本/exe(见下文)

要运行基准测试,Apache基准测试工具“ab”必须位于系统路径上,或者通过--ab=path选项指定。

要运行modpython测试,“apache”可执行文件或脚本必须位于系统路径上,或者通过--apache=path选项提供。在某些平台上,“apache”可能被称为“apachectl”或“apache2ctl”——如果需要,创建一个到它们的符号链接。

class cherrypy.test.benchmark.ABSession(path='/cpbench/users/rdelon/apps/blog/hello', requests=1000, concurrency=10)[源代码]

基类:object

“ab”会话,ApacheHTTP服务器基准测试工具。

AB输出示例:

这是ApacheBench,版本2.0.40-DEV< $修订:1.121.2.1美元> ApACHE-2.0版权(C)1996 Adam Twiss,ZeUS技术有限公司,HTTP://www. ZueStuc.NET/版权(C)1998至2002年Apache软件基金会,HTTP://www. APACHE.Org/

基准127.0.0.1(Be Patient)完成100个请求完成200个请求完成300个请求完成400个请求完成500个请求完成600个请求完成700个请求完成800个请求完成900个请求

服务器软件:cherrypy/3.1 beta服务器主机名:127.0.0.1服务器端口:54583

文档路径:/static/index.html文档长度:14字节

并发级别:测试所用的10个时间:9.643867秒完成请求:1000个失败请求:0个写入错误:0总传输:189000字节HTML传输:14000字节请求/秒:103.69 [#/sec] (平均)每次请求的时间:96.439 [ms] (平均)每次请求的时间:9.644 [ms] (所有并发请求的平均值)传输速率:19.08 [Kbytes/sec] 收到

连接时间(ms)

最小平均值 [+/-sd] 最大中值

连接:0 0 2.9 0 10处理:20 94 7.3 90 130等待:0 43 28.1 40 100总计:20 95 7.3 100 130

在特定时间内(ms)服务的请求的百分比

50%100 66%100 75%100 80%100 90%100 95%100 98%100 99%110

100%130(最长请求)

已完成1000个请求

args()[源代码]
parse_patterns = [('complete_requests', 'Completed', b'^Complete requests:\\s*(\\d+)'), ('failed_requests', 'Failed', b'^Failed requests:\\s*(\\d+)'), ('requests_per_second', 'req/sec', b'^Requests per second:\\s*([0-9.]+)'), ('time_per_request_concurrent', 'msec/req', b'^Time per request:\\s*([0-9.]+).*concurrent requests\\)$'), ('transfer_rate', 'KB/sec', b'^Transfer rate:\\s*([0-9.]+)')]
run()[源代码]
class cherrypy.test.benchmark.Root[源代码]

基类:object

hello()[源代码]
index()[源代码]
sizer(size)[源代码]
cherrypy.test.benchmark.print_report(rows)[源代码]
cherrypy.test.benchmark.run_standard_benchmarks()[源代码]
cherrypy.test.benchmark.size_report(sizes=(10, 100, 1000, 10000, 100000, 100000000), concurrency=50)[源代码]
cherrypy.test.benchmark.thread_report(path='/cpbench/users/rdelon/apps/blog/hello', concurrency=(25, 50, 100, 200, 400))[源代码]