{"_id":"@ember-performance-monitoring/tracerbench-compare-action","_rev":"2-d17c349ed95792a4031960bfcf39f7aa","name":"@ember-performance-monitoring/tracerbench-compare-action","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ember-performance-monitoring/tracerbench-compare-action","private":false,"description":"Utils and a GithubAction for using tracerbench compare in CI","version":"0.1.0","author":{"name":"Chris Thoburn","email":"runspired@gmail.com"},"license":"MIT","dependencies":{"@actions/core":"^1.2.1","@actions/github":"^2.0.1","execa":"^4.0.0","har-remix":"^2.3.0","is-reachable":"^4.0.0","tracerbench":"^3.0.11"},"main":"src/analyze.js","engines":{"node":"10.* || >= 12.*"},"volta":{"node":"12.14.1","yarn":"1.21.1"},"gitHead":"640404de03e5999795a9d86ad6fb921e0e637ac9","_id":"@ember-performance-monitoring/tracerbench-compare-action@0.1.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-5Q/Ao/O51B69lXz5DUfk4xowrS/Ke1KeyDCge6irzB7oUXWAAw3Cza2fmnuZ1ynNR7IQ+RMOsHH3HeQw3rZSpA==","shasum":"478ee8164c7ab951b1bdab6bdaea3bb879625c59","tarball":"https://registry.npmjs.org/@ember-performance-monitoring/tracerbench-compare-action/-/tracerbench-compare-action-0.1.0.tgz","fileCount":3,"unpackedSize":12408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeI4zyCRA9TVsSAnZWagAA4PoP/jeaVO09lFEVHZVXxzM7\nZgX9omqOAMvWitTP5s4cByQTP11HGHwaLBBRL8qvm+BigRBvUMmhqUfCWqBJ\nUBKydeSH9NChcxC5mrqh0LnJsx6sKRnOpVg5/pdyfFW/+tW9HCy0udzJrg/L\nfBi4bnh6fKnFOvb6AiXNYwFgqpNIH+W4yjDZeEu0ic6XPw4+Ag99fG03+VSl\nr82clvI9ZrNLiw4XBDBOAZgbqlybT1sMyoa/Bw62BVq3JVdq6pfJr6wE4oIE\n6lrUmrdsHt09znx9SoE4HvVKU4fglJZPZYqRwlp7sSPjhWjzXca9tqJ1uy/T\n5wIrvkvgggiJM4GYPz+ZkLcm3dH7P88FScdiXs7Asx+VU9vlHHfRibif2r6+\nn9lQP5evSaaRKsZl6UxkPrnq3Z0kPWNG4NmAjsOQ9QYiDNV80gI51HE9jG4P\nocJN+Ppj5WBRGZ84amtbPnYbxGeiZPrjb0EYiK3l0HVvkcLxI4syqNh66Wfk\nD+/pVrE6kzW6htpTagbdVRykfa6u0rKCKd6lA4qeMvjfS77GuvsCe07kcr9u\noQEXUR6LGqDobRfq3RMQA1oUCRYb2YJxfbT8TEU0Wl0vhEIjdfV/uZ50stZC\nGEd8RCpq3aqsR67ozTHMnuzJLpgxByUDhczTAoM89LT7cIUbukxrDfrl1dm0\nW5Iu\r\n=/pm1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICp3KlOzDX0VJwEv+qNbEu0+/s2GR2SOptlG6NZcZcZAAiEA3ZsdjUs/IQOpki9S+OtBH3Puxo4BoYoCUik6f3CIA3M="}]},"maintainers":[{"name":"runspired","email":"runspired@gmail.com"}],"_npmUser":{"name":"runspired","email":"runspired@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracerbench-compare-action_0.1.0_1579388146535_0.7341011876409027"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-18T22:55:46.321Z","0.1.0":"2020-01-18T22:55:46.656Z","modified":"2022-04-05T07:28:49.858Z"},"maintainers":[{"email":"eflanagan@innovu.com","name":"efx"},{"email":"runspired@gmail.com","name":"runspired"}],"description":"Utils and a GithubAction for using tracerbench compare in CI","author":{"name":"Chris Thoburn","email":"runspired@gmail.com"},"license":"MIT","readme":"# @ember-performance-monitoring/tracerbench-compare-action\n\nCommit over Commit Performance Analysis Automation for Web Applications.\n\nSamples and Analysis are gathered using [Tracerbench](https://github.com/TracerBench/tracerbench) [Compare](https://github.com/TracerBench/tracerbench/tree/master/packages/cli#tracerbench-compare)\n\n## What is it?\n\nThink \"Lighthouse CI\" but with statistical rigor and more meaningful data.\n\nThis library is general enough it could be used to benchmark any Web\n Application with any CI setup via Tracerbench; however, it comes \n finely tuned for benchmarking Ember applications and Addons via a \n Github Action.\n\n## Initial Setup\n\nTo use this, place markers with `performance.mark(<markerName>)` in your \napplication at key points. You can then conigure `tracerbench` to use a\nsubset (or all) of these markers to create a segmented analysis.\n\nCurrently, in order for Tracerbench to know when to stop analyzing your application\n it needs to redirect to `about:blank` after the `Paint` event following the last \n `marker` you care about. Typically in an Ember Application this means adding the\n following in whichever route is being benchmarked. This constraint may be removed\nin the future.\n\n ```ts\nclass MyRoute extends Route {\n  afterModel() {\n      if (document.location.href.indexOf('?tracing') !== -1) {\n      endTrace();\n    }\n  }\n}\n\n function endTrace() {\n  // just before paint\n  requestAnimationFrame(() => {\n    // after paint\n    requestAnimationFrame(() => {\n      document.location.href = 'about:blank';\n    });\n  });\n}\n```\n\n## Usage as a GithubAction\n\nYou can use this action by adding it to an existing workflow\n or creating a new workflow in your project.\n\nFor example, the below adds a check for the `users` route to all\n pull requests to the master branch.\n\n```yml\nname: PerformanceCheck\n\non:\n  pull_request:\n    branches:\n      - master\n\njobs:\n  analyze-users-route:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v1\n        with:\n          fetch-depth: 0\n      - uses: ember-performance-monitoring/tracerbench-compare-action@master\n        with:\n          experiment-url: 'http://localhost:4201/users'\n          control-url: 'http://localhost:4200/users'\n          markers: 'end-users-model-load'\n          regression-threshold: 25\n          fidelity: high\n```\n\n## Local Usage and Usage with other CI Systems\n\nThe GithubAction this project provides is actually a small wrapper that pipes\n the configuration into the project's `main`. This allows for easy use in any \n setup (local or CI) by adding this action as a dependency.\n\n ```cli\n yarn add @ember-performance-monitoring/tracerbench-compare-action\n ```\n\nFor example, you could mirror the above check in an Ember Application by doing the following.\n\n```json\n{\n  \"experiment-url\": \"http://localhost:4201/users\",\n  \"control-url\": \"http://localhost:4200/users\",\n  \"markers\": \"end-users-model-load\",\n  \"regression-threshold\": 25,\n  \"fidelity\": \"high\"\n}\n```\n\n```js\nconst analyze = require('@ember-performance-monitoring/tracerbench-compare-action');\nconst config = require('./perf-test-config.json');\n\nanalyze(config);\n```\n\n## Configuration Options\n\n| Option | Default | Description |\n| ------ | ------- | ----------- |\n| build-control | true | Whether to build assets for the control case |\n| build-experiment | true | Whether to build assets for the experiment case |\n| control-dist | ./dist-control | The location of the control assets once a build has been performed (or if build-control is false the location they are already) |\n| experiment-dist | ./dist-experiment | The location of the experiment assets once a build has been performed (or if build-control is false the location they are already) |\n| control-sha | git rev-parse --short=8 origin/master | SHA to be built for the control commit |\n| experiment-sha | git rev-parse --short=8 HEAD | SHA to be built for the experiment commit |\n| experiment-ref | current branch or tag | The reference being built for the experiment |\n| control-build-command | ember build -e production --output-path ${control-dist} | command to execute to build control assets if build-control is true\n| experiment-build-command | ember build -e production --output-path ${experiment-dist} | command to execute to build experiment assets if build-experiment is true\n| use-yarn | true | When building control/experiment whether to use yarn for install (npm is used otherwise) |\n| control-serve-command | ember s --path=${control-dist} | command to execute to serve the control assets |\n| experiment-serve-command | ember s --path=${experiment-dist} | command to execute to serve the experiment assets |\n| clean-after-analyze | true if experiment-ref is preset, false otherwise | whether to try to restore initial repository state after the benchmark is completed. Useful for local runs. |\n\n## Tracerbench Config\n\nThe following options are supplied directly to the `tracerbench compare` command that is run once the \nassets for control and experiment are being served.\n\n| Option | Default | Description |\n| ------ | ------- | ----------- |\n| control-url | http://localhost:4200?tracing=true | url to benchmark at which the control assets are being served |\n| experiment-url | http://localhost:4201?tracing=true | url to benchmark at which the experiment assets are being served |\n| fidelity | low | how many runs to perform. high (50) is recommended for CI |\n| markers | domComplete | comma separated list of markers to consider in the report |\n| runtime-stats | false | whether to analyze chrome runtime stats (expensive and degrades the rigor of the rest of the test) }\n| report | true | whether to produce a report PDF |\n| headless | true | whether to run Chrome in headless mode |\n| regression-threshold | 50 | milliseconds of change at which to fail the test |\n","readmeFilename":"README.md"}