mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 11:44:05 +08:00
feat(@angular/cli): add tracking for command duration
This commit is contained in:
parent
2ffbdfa86a
commit
600b0218fd
@ -180,9 +180,14 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
|
|||||||
} else if (options.help === 'json' || options.help === 'JSON') {
|
} else if (options.help === 'json' || options.help === 'JSON') {
|
||||||
return this.printJsonHelp(options);
|
return this.printJsonHelp(options);
|
||||||
} else {
|
} else {
|
||||||
|
const startTime = +new Date();
|
||||||
await this.reportAnalytics([this.description.name], options);
|
await this.reportAnalytics([this.description.name], options);
|
||||||
|
const result = await this.run(options);
|
||||||
|
const endTime = +new Date();
|
||||||
|
|
||||||
return await this.run(options);
|
this.analytics.timing(this.description.name, 'duration', endTime - startTime);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user