install.fairie/.config/taskfiles/nest/Taskfile.yml
Brian Zalewski f42899b107 Latest
2022-12-24 15:04:59 -05:00

28 lines
1.1 KiB
YAML

---
version: '3'
tasks:
benchmark:
deps:
- :install:npm:autocannon
- :install:npm:clinic
desc: Initiate a web server benchmarking session (with `clinic`)
hide: '{{ne (print .REPOSITORY_TYPE "-" .REPOSITORY_SUBTYPE) "npm-app"}}'
summary: |
# Initiate a web server benchmarking session with `clinic`
This task runs a basic stress test on an endpoint that is `/` by default.
See the examples below for stress testing an endpoint other than the default.
For more information, see the [`clinic` GitHub page](https://github.com/clinicjs/node-clinic).
**Example usage:**
`task npm:benchmark`
**Example with custom endpoint:**
`task npm:benchmark -- /custom/endpoint`
log:
error: Error encountered while running clinic with autocannon on `dist/main.js`
start: Running clinic with autocannon on `dist/main.js`
success: Finished running clinic with autocannon on `dist/main.js`
cmds:
- clinic doctor --autocannon [ {{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}/{{end}} --method POST ] -- node ./dist/main.js