install.fairie/.config/taskfiles/nest/Taskfile.yml

29 lines
1.1 KiB
YAML
Raw Normal View History

2022-12-24 12:04:59 -08:00
---
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