$ ab -V This is ApacheBench, Version 2.3 <$Revision: 1874286 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
$ ab --help ab: wrong number of arguments Usage: ab [options] [http://]hostname[:port]/path Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make at a time -t timelimit Seconds to max. to spend on benchmarking This implies -n 50000 -s timeout Seconds to max. wait for each response Default is 30 seconds -b windowsize Size of TCP send/receive buffer, in bytes -B address Address to bind to when making outgoing connections -p postfile File containing data to POST. Remember also to set -T -u putfile File containing data to PUT. Remember also to set -T -T content-type Content-type header to use for POST/PUT data, eg. 'application/x-www-form-urlencoded' Default is 'text/plain' -v verbosity How much troubleshooting info to print -w Print out results in HTML tables -i Use HEAD instead of GET -x attributes String to insert as table attributes -y attributes String to insert as tr attributes -z attributes String to insert as td or th attributes -C attribute Add cookie, eg. 'Apache=1234'. (repeatable) -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip' Inserted after all normal header lines. (repeatable) -A attribute Add Basic WWW Authentication, the attributes are a colon separated username and password. -P attribute Add Basic Proxy Authentication, the attributes are a colon separated username and password. -X proxy:port Proxyserver and port number to use -V Print version number and exit -k Use HTTP KeepAlive feature -d Do not show percentiles served table. -S Do not show confidence estimators and warnings. -q Do not show progress when doing more than 150 requests -l Accept variable document length (use this for dynamic pages) -g filename Output collected data to gnuplot format file. -e filename Output CSV file with percentages served -r Don't exit on socket receive errors. -m method Method name -h Display usage information (this message)
$ ab -c 10 -n 100 http://www.baidu.com/ This is ApacheBench, Version 2.3 <$Revision: 1874286 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.baidu.com (be patient).....done
Server Software: BWS/1.1 Server Hostname: www.baidu.com Server Port: 80
Document Path: / Document Length: 347961 bytes
Concurrency Level: 10 Time taken for tests: 4.771 seconds Complete requests: 100 Failed requests: 97 (Connect: 0, Receive: 0, Length: 97, Exceptions: 0) Total transferred: 34933333 bytes HTML transferred: 34811246 bytes Requests per second: 20.96 [#/sec] (mean) Time per request: 477.127 [ms] (mean) Time per request: 47.713 [ms] (mean, across all concurrent requests) Transfer rate: 7150.00 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 36 44 5.5 43 66 Processing: 181 396 65.9 399 589 Waiting: 39 91 48.2 85 330 Total: 223 440 66.3 443 629
Percentage of the requests served within a certain time (ms) 50% 443 66% 462 75% 469 80% 475 90% 509 95% 551 98% 608 99% 629 100% 629 (longest request)
-c 10 表示并发用户数为10
`-n100 表示请求总数为100
http://www.baidu.com/ 表示请求的目标URL
这行表示同时处理100个请求并运行10次。
测试结果也一目了然,apache测试出的吞吐率为:Requests per second: 20.96 [#/sec] (mean)
Total transferred 表示所有请求的响应数据长度总和,包括每个HTTP响应数据的头信息和正文数据的长度。注意这里不包括HTTP请求数据的长度,仅仅为web服务器流向用户PC的应用层数据总长度。
HTML transferred 表示所有请求的响应数据中正文数据的总和,也就是减去了Total transferred中HTTP响应数据中的头信息的长度。
Requests per second 吞吐率,计算公式:Complete requests/Time taken for tests
Time per request 用户平均请求等待时间,计算公式:Time token for tests/(Complete requests/Concurrency Level)。
Time per requet (across all concurrent request)服务器平均请求等待时间,计算公式:Time taken for tests/Complete requests,正好是吞吐率的倒数。也可以这么统计:Time per request/Concurrency Level。
Transfer rate 表示这些请求在单位时间内从服务器获取的数据长度,计算公式:Total trnasferred/ Time taken for tests,这个统计很好的说明服务器的处理能力达到极限时,其出口宽带的需求量。
Percentage of the requests served within a certain time (ms)这部分数据用于描述每个请求处理时间的分布情况,比如以上测试,80%的请求处理时间都不超过6ms,这个处理时间是指前面的Time per request,即对于单个用户而言,平均每个请求的处理时间。
$ ab -c 10 -n 100 http://www.jd.com/ This is ApacheBench, Version 2.3 <$Revision: 1874286 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.jd.com (be patient).....done
Server Software: nginx Server Hostname: www.jd.com Server Port: 80
Document Path: / Document Length: 138 bytes
Concurrency Level: 10 Time taken for tests: 1.734 seconds Complete requests: 100 Failed requests: 0 Non-2xx responses: 100 Total transferred: 42300 bytes HTML transferred: 13800 bytes Requests per second: 57.66 [#/sec] (mean) Time per request: 173.433 [ms] (mean) Time per request: 17.343 [ms] (mean, across all concurrent requests) Transfer rate: 23.82 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 13 17 2.8 16 23 Processing: 15 146 30.4 150 189 Waiting: 15 88 44.5 91 182 Total: 29 163 30.8 168 206
Percentage of the requests served within a certain time (ms) 50% 168 66% 176 75% 179 80% 182 90% 189 95% 195 98% 204 99% 206 100% 206 (longest request)
通过上图,测试结果也一目了然,京东测试出的吞吐率为:Requests per second:57.66 [#/sec] (mean)
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [l1n6yun/hello]: l1n6yun/hello Description []: This is a demo package Author [l1n6yun <l1n6yun@gmail.com>, n to skip]: Minimum Stability []: dev Package Type (e.g. library, project, metapackage, composer-plugin) []: library License []: MIT
Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]? no Would you like to define your dev dependencies (require-dev) interactively [yes]? no Add PSR-4 autoload mapping? Maps namespace "L1n6yun\Hello" to the entered relative path. [src/, n to skip]:
Do you confirm generation [yes]? Generating autoload files Generated autoload files PSR-4 autoloading configured. Use "namespace L1n6yun\Hello;" in src/ Include the Composer autoloader with: require 'vendor/autoload.php';
对象A->对象B: 对象B你好吗?(请求) Note right of 对象B: 对象B的描述 Note left of 对象A: 对象A的描述(提示) 对象B-->对象A: 我很好(响应) 对象A->对象B: 你真的好吗?
6、UML时序图源码复杂样例:
1 2 3 4 5 6 7 8 9 10 11
Title: 标题:复杂使用 对象A->对象B: 对象B你好吗?(请求) Note right of 对象B: 对象B的描述 Note left of 对象A: 对象A的描述(提示) 对象B-->对象A: 我很好(响应) 对象B->小三: 你好吗 小三-->>对象A: 对象B找我了 对象A->对象B: 你真的好吗? Note over 小三,对象B: 我们是朋友 participant C Note right of C: 没人陪我玩
7、UML标准时序图样例:
1 2 3 4 5 6 7 8 9 10 11 12
%% 时序图例子,-> 直线,-->虚线,->>实线箭头 sequenceDiagram participant 张三 participant 李四 张三->王五: 王五你好吗? loop 健康检查 王五->王五: 与疾病战斗 end Note right of 王五: 合理 食物 <br/>看医生... 李四-->>张三: 很好! 王五->李四: 你怎么样? 李四-->王五: 很好!
8、甘特图样例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
%% 语法示例 gantt dateFormat YYYY-MM-DD title 软件开发甘特图 section 设计 需求 :done, des1, 2014-01-06,2014-01-08 原型 :active, des2, 2014-01-09, 3d UI设计 : des3, after des2, 5d 未来任务 : des4, after des3, 5d section 开发 学习准备理解需求 :crit, done, 2014-01-06,24h 设计框架 :crit, done, after des2, 2d 开发 :crit, active, 3d 未来任务 :crit, 5d 耍 :2d section 测试 功能测试 :active, a1, after des3, 3d 压力测试 :after a1 , 20h 测试报告 :48h
Snipaste is a simple but powerful snipping tool, and also allows you to pin the screenshot back onto the screen. Download and start the application, press F1 to start snipping, then press F3 to paste it as a floating window. That’s it!
You can also convert text or color info in the clipboard into a floating image window. Such windows can be zoomed, rotated, flipped, made translucent, and even made click-through! If you are a programmer, a designer or whoever works much time before the computer, you will be surprised how it can help you get your work done more efficiently!
Snipaste is easy and intuitive to use, but there are also many hidden features that can make your life even more efficient. Read the manual if you are interested.
Intuitive snipping
Auto detect UI elements
Pixel-level control
Color picker (try F1, C, F3)
History play back (,/.)
Multi-screen support
HiDPI (retina display) support
Paste images as topmost floating windows
The source (in the clipboard) could be
Image
Plain text
HTML text
Color info text
Image files: PNG, JPG, BMP, TGA, ICO, TIFF and GIF
Supported operations
Zoom (mouse scroll or +/-) or set speed for GIF
Rotate (1/2) or jump to previous/next frame for GIF
Flip (3/4)
Set transparency (Ctrl + mouse scroll or Ctrl + +/-)