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 -DCreate example scenario file.
npx rtimer initRun 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();
}
})nameis option to specify scenario. It is used to audit single scenario with--nameoption of CLI command.outDiris option to specify path to output performance timeline json. In this example's case, output file will be stored in[PJroot]/timeline/example/moreInfo.startUrlis start point of audit.prepareis callback function (optional). This function will be called beforetrigercallback. Usualy, it is useful for authentication.trigeris callback function. rendering-timer lunch puppeteer withstartUrlthen, callpreparecallback andtrigercallback. After exittrigercallback, 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.
--timesis option for specify number of trials. Analyze result contains avarage of them.--nameis 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.
--outputis 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.
