Skip to content

Commit

Permalink
Fix metrics variable declaration to use alphabetical order
Browse files Browse the repository at this point in the history
With the multiplication of metrics, use alphabetical ordering to ease
searches.
  • Loading branch information
thibmeu committed Feb 9, 2024
1 parent 92ef2a9 commit e193ae5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/context/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,33 @@ export class MetricsRegistry {
registry: RegistryType;
options: RegistryOptions;

requestsTotal: CounterType;
directoryCacheMissTotal: CounterType;
erroredRequestsTotal: CounterType;
issuanceRequestTotal: CounterType;
keyRotationTotal: CounterType;
keyClearTotal: CounterType;
issuanceRequestTotal: CounterType;
requestsTotal: CounterType;
signedTokenTotal: CounterType;
directoryCacheMissTotal: CounterType;

constructor(options: RegistryOptions) {
this.options = options;
this.registry = new Registry();

this.requestsTotal = this.registry.create('counter', 'requests_total', 'total requests');
this.directoryCacheMissTotal = this.registry.create(
'counter',
'directory_cache_miss_total',
'Number of requests for private token issuer directory which are not served by the cache.'
);
this.erroredRequestsTotal = this.registry.create(
'counter',
'errored_requests_total',
'Errored requests served to eyeball'
);
this.issuanceRequestTotal = this.registry.create(
'counter',
'issuance_request_total',
'Number of requests for private token issuance.'
);
this.keyRotationTotal = this.registry.create(
'counter',
'key_rotation_total',
Expand All @@ -41,21 +50,12 @@ export class MetricsRegistry {
'key_clear_total',
'Number of key clear performed.'
);
this.issuanceRequestTotal = this.registry.create(
'counter',
'issuance_request_total',
'Number of requests for private token issuance.'
);
this.requestsTotal = this.registry.create('counter', 'requests_total', 'total requests');
this.signedTokenTotal = this.registry.create(
'counter',
'signed_token_total',
'Number of issued signed private tokens.'
);
this.directoryCacheMissTotal = this.registry.create(
'counter',
'directory_cache_miss_total',
'Number of requests for private token issuer directory which are not served by the cache.'
);
}

/**
Expand Down

0 comments on commit e193ae5

Please sign in to comment.