Provides tool for audit rendering performance.
It doesn't require any modification for target Web site.
- Measure the time required for screen transitions.
- Enable audit CSR performance.
- No need to modify target website.
- Image-based determination of rendering completion.
- Easily compare multiple website.
- Puppeteer-based testing scenario.
Execute following command.
npm install rendering-timer -D
Create example scenario file.
npx rtimer init
Run Rtimer. Then, you can see report on your console.
npx rtimer audit
- Create scenario files.
- Create rtimer.config.json if you need.
- Run audit command to correct performance timeline files.
- Run analyze command to analyze performance from performance timeline files.
rendering-timer need scenario files
to audit performance.
const { Scenario } = require('rendering-timer');
module.exports = new Scenario({
name: 'exampleScenario',
outDir: 'example/moreInfo',
startUrl: 'https://example.com/',
/*
prepare: async (page) => {
await page.type('#userIdInput', 'userId');
await page.type('#passwordInput', 'password');
await page.$('#loginButton').click();
}
*/
triger: async (page) => {
const link = await page.$('a');
if(!link) return console.error('link was not found')
await link.click();
}
})
name
is option to specify scenario. It is used to audit single scenario with--name
option of CLI command.outDir
is option to specify path to output performance timeline json. In this example's case, output file will be stored in[PJroot]/timeline/example/moreInfo
.startUrl
is start point of audit.prepare
is callback function (optional). This function will be called beforetriger
callback. Usualy, it is useful for authentication.triger
is callback function. rendering-timer lunch puppeteer withstartUrl
then, callprepare
callback andtriger
callback. After exittriger
callback, rendering-timer start to collect performance timeline.
triger
and prepare
recieve page object of puppeteer. So, you can use puppeteer APIs.
See puppeteer docs.
npx rtimer <command> [options]
Start performance audit with puppeteer, and create performance timiline files for each scenarios.
You need to create scenario files
to run this command.
--times
is option for specify number of trials. Analyze result contains avarage of them.--name
is option to audit with single scenario file.
Start analyze performance timeline files.
You need to run audit
command to create performance timeline files before running this command.
--output
is option for specify output file type. ("csv" | "json")
Run audit
command then, run analyze
command.
Options for audit
and analyze
can be specified.
Create example scenario file.
Show help text.