Continuous integration for performance monitoring
MIT License
npm install perfbench --save
Build and run your application in your CI and then invoke perfbench
package.json
:
"name": "my-awesome-app",
"scripts": {
"pretest": "npm run build && pm2 start server.js",
"test": "perfbench"
}
Drop a YAML file .perf.yml
in the root of your repository.
url: http://localhost:3000 # the url you want to test
fail: false # optional, default: true. false will only show a warning
thresholds: # all rows are optional. add to customize the threshold
- first-meaningful-paint: 1600 # optional, default: 1600, value in ms
- speed-index-metric: 1250 # optional, default: 1250
- time-to-interactive: 2500 # optional, default: 2500, value in ms
- total-byte-weight: 1600 # optional, default: 1600, value in Kb
You can also add custom properties.
Send a user timing performance event from your javascript.
performance.mark('Page ready')
And add the kebabcased key to .perf.yml
thresholds:
- page-ready: 1500
For travis users, if you would like to run perfbench in pull_request
instead of push
,
set event-type: pull_request
event-type: pull_request
Currently works for Travis CI, CircleCI, Wercker, and Drone.
Authorize perfbench
for status access, copy the generated token.
Add this token as PERFBENCH_GITHUB_TOKEN
as environment parameter in your CIs project settings.
(Ask me for help if you're stuck)
⭐ this repo
MIT © siddharthkp