Repository: mcollina/autocannon Branch: master Commit: 225e3a30a6ad Files: 105 Total size: 335.6 KB Directory structure: gitextract_p81k9btq/ ├── .github/ │ ├── dependabot.yml │ ├── release-drafter.yml │ ├── tests_checker.yml │ └── workflows/ │ └── nodejs.yml ├── .gitignore ├── .npmignore ├── .taprc ├── LICENSE ├── README.md ├── autocannon.js ├── cluster.js ├── for-zero-x.js ├── help.txt ├── lib/ │ ├── aggregateResult.js │ ├── defaultOptions.js │ ├── format.js │ ├── histUtil.js │ ├── httpClient.js │ ├── httpMethods.js │ ├── httpRequestBuilder.js │ ├── init.js │ ├── manager.js │ ├── multipart.js │ ├── noop.js │ ├── parseHAR.js │ ├── pipelinedRequestsQueue.js │ ├── preload/ │ │ └── autocannonDetectPort.js │ ├── printResult.js │ ├── progressTracker.js │ ├── requestIterator.js │ ├── run.js │ ├── runTracker.js │ ├── subargAliases.js │ ├── url.js │ ├── util.js │ ├── validate.js │ ├── worker.js │ └── worker_threads.js ├── package.json ├── samples/ │ ├── bench-multi-url.js │ ├── customise-individual-connection.js │ ├── customise-verifyBody-workers.js │ ├── customise-verifyBody.js │ ├── helpers/ │ │ ├── on-response.js │ │ ├── setup-request.js │ │ └── verify-body.js │ ├── init-context.js │ ├── modifying-request.js │ ├── request-context-workers.js │ ├── request-context.js │ ├── requests-sample.js │ ├── track-run-workers.js │ ├── track-run.js │ └── using-id-replacement.js ├── server.js └── test/ ├── aggregateResult.test.js ├── argumentParsing.test.js ├── basic-auth.test.js ├── cert.pem ├── cli-ipc.test.js ├── cli.test.js ├── debug.test.js ├── envPort.test.js ├── fixtures/ │ ├── example-result.json │ ├── httpbin-get.json │ ├── httpbin-post.json │ ├── httpbin-simple-get.json │ └── multi-domains.json ├── forever.test.js ├── format.test.js ├── helper.js ├── httpClient.test.js ├── httpRequestBuilder.test.js ├── key.pem ├── keystore.pkcs12 ├── onPort.test.js ├── parseHAR.test.js ├── pipelinedRequestsQueue.test.js ├── printResult-process.js ├── printResult-renderStatusCodes.test.js ├── printResult.test.js ├── progressTracker.test.js ├── progressTracker.test.stub.js ├── requestIterator.test.js ├── run.test.js ├── runAmount.test.js ├── runMultiServer.test.js ├── runMultipart.test.js ├── runRate.test.js ├── sampleInt.test.js ├── serial/ │ ├── autocannon.test.js │ ├── run.test.js │ ├── tap-parallel-not-ok │ └── wasm.test.js ├── subargAliases.test.js ├── tap-parallel-ok ├── targetProcess.js ├── url.test.js ├── utils/ │ ├── has-worker-support.js │ ├── on-response.js │ ├── setup-client.js │ ├── setup-request.js │ └── verify-body.js ├── validate.test.js └── workers.test.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: github-actions directory: '/' schedule: interval: daily open-pull-requests-limit: 10 - package-ecosystem: npm directory: '/' schedule: interval: daily open-pull-requests-limit: 10 ================================================ FILE: .github/release-drafter.yml ================================================ template: | ## What’s Changed $CHANGES ================================================ FILE: .github/tests_checker.yml ================================================ comment: 'Could you please add tests to make sure this change works as expected?', fileExtensions: ['.php', '.ts', '.js', '.c', '.cs', '.cpp', '.rb', '.java'] testDir: 'test' ================================================ FILE: .github/workflows/nodejs.yml ================================================ name: Node.js CI on: [ push, pull_request ] # This allows a subsequently queued workflow run to interrupt previous runs concurrency: group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true jobs: test: runs-on: ${{ matrix.os }} permissions: contents: read strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] node-version: [20, 22] steps: - uses: actions/checkout@v3 with: persist-credentials: false - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: node --version - run: npm --version - run: npm install - run: npm test env: CI: true automerge: if: > github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' needs: test runs-on: ubuntu-latest permissions: pull-requests: write contents: write steps: - uses: fastify/github-action-merge-dependabot@v3 with: exclude: 'chalk;pretty-bytes' github-token: ${{ secrets.github_token }} ================================================ FILE: .gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage *.lcov # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Snowpack dependency directory (https://snowpack.dev/) web_modules/ # TypeScript cache *.tsbuildinfo # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ .rts2_cache_es/ .rts2_cache_umd/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.test # parcel-bundler cache (https://parceljs.org/) .cache .parcel-cache # Next.js build output .next out # Nuxt.js build / generate output .nuxt dist # Gatsby files .cache/ # Comment in the public line in if your project uses Gatsby and not Next.js # https://nextjs.org/blog/next-9-1#public-directory-support # public # vuepress build output .vuepress/dist # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # TernJS port file .tern-port # Stores VSCode versions used for testing VSCode extensions .vscode-test # yarn v2 .yarn/cache .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz .pnp.* # Vim swap files *.swp # macOS files .DS_Store # lock files package-lock.json yarn.lock # editor files .vscode .idea # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release profile-* .devcontainer .history ================================================ FILE: .npmignore ================================================ # Logs logs *.log npm-debug.log* # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # node-waf configuration .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directory node_modules # Optional npm cache directory .npm # Optional REPL history .node_repl_history profile-* demo.gif server.js *.png appveyor.yml .travis.yml .github .nyc_output ================================================ FILE: .taprc ================================================ ts: false jsx: false flow: false timeout: 900 branches: 60 functions: 60 lines: 60 statements: 60 ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2016 Matteo Collina Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ ![banner](autocannon-banner.png) # autocannon ![Node.js CI](https://github.com/mcollina/autocannon/workflows/Node.js%20CI/badge.svg) ![demo](https://raw.githubusercontent.com/mcollina/autocannon/master/demo.gif) An HTTP/1.1 benchmarking tool written in node, greatly inspired by [wrk][wrk] and [wrk2][wrk2], with support for HTTP pipelining and HTTPS. On _my_ box, *autocannon* can produce more load than `wrk` and `wrk2`, see [limitations](#limitations) for more details. * [Installation](#install) * [Usage](#usage) * [API](#api) * [Acknowledgements](#acknowledgements) * [License](#license) ## Install ``` npm i autocannon -g ``` or if you want to use the [API](#api) or as a dependency: ``` npm i autocannon --save ``` ## Usage ### Command Line ``` Usage: autocannon [opts] URL URL is any valid HTTP or HTTPS URL. If the PORT environment variable is set, the URL can be a path. In that case 'http://localhost:$PORT/path' will be used as the URL. Available options: -c/--connections NUM The number of concurrent connections to use. default: 10. -p/--pipelining NUM The number of pipelined requests to use. default: 1. -d/--duration SEC The number of seconds to run the autocannon. default: 10. -a/--amount NUM The number of requests to make before exiting the benchmark. If set, duration is ignored. -L NUM The number of milliseconds to elapse between taking samples. This controls the sample interval, & therefore the total number of samples, which affects statistical analyses. default: 1. -S/--socketPath A path to a Unix Domain Socket or a Windows Named Pipe. A URL is still required to send the correct Host header and path. -w/--workers Number of worker threads to use to fire requests. -W/--warmup Use a warm up interval before starting sampling. This enables startup processes to finish and traffic to normalize before sampling begins use -c and -d sub args e.g. `--warmup [ -c 1 -d 3 ]` --on-port Start the command listed after -- on the command line. When it starts listening on a port, start sending requests to that port. A URL is still required to send requests to the correct path. The hostname can be omitted, `localhost` will be used by default. If the command after -- is `node