Skip to content

Commit

Permalink
feat: rename one of the metrics (#12)
Browse files Browse the repository at this point in the history
* Rename the methods for one of the metrics

* Upgrade '@smoya/asyncapi-adoption-metrics' to latest version
  • Loading branch information
peter-rr authored Jan 31, 2024
1 parent 33759d2 commit 4e22ebf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@oclif/core": "^1.26.2",
"@oclif/errors": "^1.3.6",
"@oclif/plugin-not-found": "^2.3.22",
"@smoya/asyncapi-adoption-metrics": "^2.3.0",
"@smoya/asyncapi-adoption-metrics": "^2.4.0",
"@smoya/multi-parser": "^4.0.0",
"@stoplight/spectral-cli": "6.9.0",
"ajv": "^8.12.0",
Expand Down
6 changes: 3 additions & 3 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default abstract class extends Command {
}
}

async recordActionExecuted(action: string, metadata: MetricMetadata = {}, rawDocument?: string) {
async recordActionFinished(action: string, metadata: MetricMetadata = {}, rawDocument?: string) {
if (rawDocument !== undefined) {
try {
const {document} = await this.parser.parse(rawDocument);
Expand All @@ -47,7 +47,7 @@ export default abstract class extends Command {
}

const callable = async function(recorder: Recorder) {
await recorder.recordActionExecuted(action, metadata);
await recorder.recordActionFinished(action, metadata);
};

await this.recordActionMetric(callable);
Expand Down Expand Up @@ -75,7 +75,7 @@ export default abstract class extends Command {
async finally(error: Error | undefined): Promise<any> {
await super.finally(error);
this.metricsMetadata['success'] = error === undefined;
await this.recordActionExecuted(this.id as string, this.metricsMetadata, this.specFile?.text());
await this.recordActionFinished(this.id as string, this.metricsMetadata, this.specFile?.text());
}

recorderFromEnv(prefix: string): Recorder {
Expand Down

0 comments on commit 4e22ebf

Please sign in to comment.