cli icon indicating copy to clipboard operation
cli copied to clipboard

[CLI] Measure AsyncAPI DX metrics

Open Amzani opened this issue 1 year ago • 2 comments

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-analytics file 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());
  }

Amzani avatar Feb 15 '24 16:02 Amzani

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.

github-actions[bot] avatar Feb 15 '24 16:02 github-actions[bot]

/progress 100 Tracking for unique AsyncAPI files and users already implemented.

peter-rr avatar Mar 08 '24 11:03 peter-rr

:tada: This issue has been resolved in version 1.13.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar May 14 '24 13:05 asyncapi-bot