mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +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') {
|
||||
return this.printJsonHelp(options);
|
||||
} else {
|
||||
const startTime = +new Date();
|
||||
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