Skip to content

Commit

Permalink
chore: add support for recording runtime traces (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 authored Feb 13, 2023
1 parent 3df72b8 commit 95198ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface Opts {
readonly fast?: number;

readonly verbose?: boolean;
readonly runtimeTrace?: boolean;
}

const Constants = {
Expand Down Expand Up @@ -143,6 +144,10 @@ async function runPerformanceTest(opts: Opts): Promise<void> {
if (opts.verbose) {
args.push('--verbose');
}
if (opts.runtimeTrace) {
// Collects metrics for loading, navigation and v8 script compilation phases.
args.push('--runtime-trace-categories="benchmark,browser,content,loading,navigation,mojom,renderer_host,startup,toplevel,v8,disabled-by-default-loading,disabled-by-default-network,disabled-by-default-v8.compile"');
}

return new Promise(resolve => {
const npx = cp.spawn('npx', args, {
Expand Down Expand Up @@ -313,7 +318,8 @@ module.exports = async function (argv: string[]): Promise<void> {
.option('--slack-token <token>', `a Slack token for writing Slack messages`)
.option('--slack-message-threads <filepath>', `a file in which commit -> message thread mappings are stored`)
.option('-f, --fast <number>', 'what time is considered a fast performance run')
.option('-v, --verbose', 'logs verbose output to the console when errors occur');
.option('-v, --verbose', 'logs verbose output to the console when errors occur')
.option('--runtime-trace', 'enable startup tracing of the runtime');

const opts: Opts = program.parse(argv).opts();
if (opts.fast) {
Expand Down

0 comments on commit 95198ca

Please sign in to comment.