{"id":21895948,"url":"https://github.com/btfak/sniper","last_synced_at":"2025-04-06T19:12:23.177Z","repository":{"id":11919346,"uuid":"14485655","full_name":"btfak/sniper","owner":"btfak","description":"A powerful \u0026 high-performance http load tester","archived":false,"fork":false,"pushed_at":"2017-10-15T09:35:31.000Z","size":125,"stargazers_count":382,"open_issues_count":10,"forks_count":68,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-05-21T12:40:48.337Z","etag":null,"topics":["loader"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btfak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-18T07:35:53.000Z","updated_at":"2024-04-04T11:42:03.000Z","dependencies_parsed_at":"2022-08-25T09:01:53.445Z","dependency_job_id":null,"html_url":"https://github.com/btfak/sniper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btfak%2Fsniper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btfak%2Fsniper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btfak%2Fsniper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btfak%2Fsniper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btfak","download_url":"https://codeload.github.com/btfak/sniper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535519,"owners_count":20954576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["loader"],"created_at":"2024-11-28T13:41:26.783Z","updated_at":"2025-04-06T19:12:23.159Z","avatar_url":"https://github.com/btfak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nSniper\n======\n\u003eSniper is a powerful and high-performance http load tester writing in Golang. Basing on advantage of goroutine,achieving high concurrency,low memory,rich graphics display.  \n\n\n## Notice: This project is on pre-alpha stage !\n\n## Try it\nPre-compiled executables\n* [Darwin 64 bit](http://lubia-me.qiniudn.com/sniper_darwin_amd64)      \n* [Darwin 32 bit](http://lubia-me.qiniudn.com/sniper_darwin_386)\n* [Linux 64 bit](http://lubia-me.qiniudn.com/sniper_linux_amd64)\n* [Linux 32 bit](http://lubia-me.qiniudn.com/sniper_linux_386)\n* [FreeBSD 64 bit](http://lubia-me.qiniudn.com/sniper_freebsd_amd64)\n* [FreeBSD 32 bit](http://lubia-me.qiniudn.com/sniper_freebsd_386)\n* [Windows 64 bit](http://77g42f.com1.z0.glb.clouddn.com/sniper_windows_amd64.exe)\n* [Windows 32 bit](http://77g42f.com1.z0.glb.clouddn.com/sniper_windows_386.exe)\n\n## Features\n- GET / POST\n- Keep-alive\n- Https\n- Graphics display result\n- Multi-target\n- Large file support\n- Cross-platform——Linux,FreeBSD,Darwin\n\n## Compare\n\u003ctable class=\"table table-bordered table-striped table-condensed\"\u003e\n   \u003ctr\u003e\n      \u003ctd\u003etool \u003c/td\u003e\n      \u003ctd\u003elanguage \u003c/td\u003e\n      \u003ctd\u003ekeep-alive \u003c/td\u003e\n      \u003ctd\u003ehttps \u003c/td\u003e\n      \u003ctd\u003emulti-target \u003c/td\u003e\n      \u003ctd\u003eresult-show \u003c/td\u003e\n      \u003ctd\u003eproxy\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003eab \u003c/td\u003e\n      \u003ctd\u003ec \u003c/td\u003e\n      \u003ctd\u003eNO \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eNO \u003c/td\u003e\n      \u003ctd\u003ehtml，standard output\u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003esiege \u003c/td\u003e\n      \u003ctd\u003ec \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003ecsv，standard output\u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003ehttp_load \u003c/td\u003e\n      \u003ctd\u003ec \u003c/td\u003e\n      \u003ctd\u003eNO \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003estandard output\u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003ewebbench \u003c/td\u003e\n      \u003ctd\u003ec \u003c/td\u003e\n      \u003ctd\u003eNO \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eNO \u003c/td\u003e\n      \u003ctd\u003estandard output\u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n      \u003ctd\u003esniper\u003c/td\u003e\n      \u003ctd\u003ego\u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003eYES \u003c/td\u003e\n      \u003ctd\u003ejs+html5，standard output\u003c/td\u003e\n      \u003ctd\u003eNO \u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Performance\n- Memory usage less than Apache Benchmark（ab）\n- Execution speed close to ab\n- Large file support\n\n![Alt text](http://lubia-me.qiniudn.com/compare.jpg)\n\n## Graphics display\n- Analyse each request and record it\n- Output http connect time\n- Output server processing time\n- Output total time\n\nBasing on [dygraphs](http://dygraphs.com/) and html5，show the detail of server's performance. Get 1000 samples from whole result,show the details of connect,processing,and server's response.\n\nThe chart below show the total time and connect time. Wait,how can golang get the connect time ? In a word,Sniper implements part of HTTP protocol stack, discard net/http package to get the details. Also improve the performance.\n\n![Alt text](http://lubia-me.qiniudn.com/sniper_2.JPG)\n\n## Usage manual\n### 1. install Golang\n\nPlease reference  [Go install](https://github.com/astaxie/build-web-application-with-golang/blob/master/ebook/01.1.md) chapter of open-source Golang book \"build-web-application-with-golang\".\n\n### 2. install Sniper\n\n    $ go get github.com/lubia/sniper\n    $ go install github.com/lubia/sniper\n    $ cp src/github.com/lubia/sniper/.sniperc ~\n\n### 3. Parameter declaration\n\n#### Example\nGET\n\n    $sniper -c 10 -n 100 http://www.google.com\n\nPOST\n\n    $sniper -c 10 -n 100 -p postData.txt http://www.google.com\n\n#### Parameter\n\n##### Command line parameter\n\n```\nUsage:\n   sniper [options] http[s]://hostname[:port][/path]                 http or https，ip or domain support\n   sniper [options] -f urls.txt                                      multi-target，format：each url per line\nOptions:\n   -c, --concurrent     concurrent users, default is 1.              \n   -n, --requests       number of requests to perform.               \n   -r, --repetitions    number of times to run the test.             \n   -t, --time           testing time, 30 mean 30 seconds.            \n   -R, --sniperc        specify an sniperc file to get config        \n                        (default is $HOME/.sniperc).               \n   -f, --urlfile        select a specific URLS file.                 \n   -p, --post           select a specific file to POST.              \n   -T, --content-type   set Content-Type in request                  \n                        (default is text/plain).\n   -V, --Version        print the version number.                    \n   -h, --help           print this section.                          \n   -C, --config         show the current config.                     \n   -s, --plot           plot detail transactions' info               \n                        (true | false,default set true,              \n                        notice: set -t will not plot anyhow).\n\n```\n\n\n##### Config file parameter\n\n    Notice：default get config file from $HOME/.sniperc，config file and command line parameter complement each other. CMD -R to specified config file, CMD -C to get default configuration.  \n\n```\n[protocol]\nversion = HTTP/1.1                            \n#connection = keep-alive                      # to comment\nconnection = close\naccept-encoding = gzip                        \nuser-agent = golang \u0026 sniper                  \n\n[header]\n#cookie = SSID=Abh_TYcDc6YSQh-GB              user-defined header\n\n[process]\ntimeout = 30                                  socket timeout\nfailures = 64                                 max failure，socket failure over it then application break\n\n[Authenticate]\nlogin = jeff:supersecret                      HTTP Authenticate\n\n[ssl]\nssl-cert = /root/cert.pem                     ssl-cert file\nssl-key = /root/key.pem                       ssl-key file\nssl-timeout = 30                              https timeout\n```\n\n##### Output\n\nchart output to current directory \"plot.html\"\n\n```\nTransactions:                   1000 hits           total requests\nAvailability:                   100.00 %            percentage completion    \nElapsed time:                   0.15 secs           sniper elapsed time\nDocument length:               1162 Bytes           single response length\nTotalTransfer:                  1.11 MB             total data transfer\nTransaction rate:            6625.60 trans/sec      transactions per second\nThroughput:                     7.34 MB/sec         throughput\nSuccessful:                     1000 hits           result code not 200 also successful\nFailed:                           0 hits            socket errors\nTransactionTime:               1.495 ms(mean)       each request total time (average)\nConnectionTime:                0.596 ms(mean)       connect time(average，tcp handshake)\nProcessTime:                   0.900 ms(mean)       TransactionTime = ConnectionTime + ProcessTime\nStateCode:                    1000(code 200)        the number of result code is 200\n```\n## About\n#### Twin projects\n\n- [gohttpbench](https://github.com/parkghost/gohttpbench)\n- [vegeta](https://github.com/tsenart/vegeta)\n\n#### Author\n\nBlog：[Programer](http://www.btfak.com)\n\nContact：yanyuan2046 at 126.com\n\n#### Licence\n[Apache License, Version 2.0.](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n#### [中文文档](https://github.com/btfak/sniper/blob/master/README_CN.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtfak%2Fsniper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtfak%2Fsniper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtfak%2Fsniper/lists"}