cli
cli copied to clipboard
[CLI] Measure AsyncAPI DX metrics
Related to https://github.com/Amzani/asyncapi-metrics-dashboard/issues/5
After merging https://github.com/asyncapi/cli/pull/859, we need to track unique AsyncAPI Files and users, see https://github.com/Amzani/asyncapi-metrics-dashboard/issues/2
Definition of done
- We expected to use the
.asyncapi-analyticsfile to store user IDs (UUID v4 is perfect) - We use SHA1 (FileName) for identifying AsyncAPI File Names
- Analytics documentation is updated to inform users about what we collect
- We don't impact CLI performance
Example of hardcoded values I've used for testing purpose in base.ts
async finally(error: Error | undefined): Promise<any> {
await super.finally(error);
this.metricsMetadata['success'] = error === undefined;
this.metricsMetadata['user'] = 'c320a14b-37f7-4a44-bdf0-9bf3ec22b652';
this.metricsMetadata['source'] = this.generateSHA1(this.specFile?.getSource() || '');
console.log('getFileURL', this.specFile?.getSource(), 'hash', this.generateSHA1(this.specFile?.getSource() || ''));
await this.recordActionFinished(this.id as string, this.metricsMetadata, this.specFile?.text());
}
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
/progress 100 Tracking for unique AsyncAPI files and users already implemented.
:tada: This issue has been resolved in version 1.13.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: