Skip to content

Commit a0de2ba

Browse files
committed
added more metrics in inboundTransferModel
1 parent 04f2d07 commit a0de2ba

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

modules/api-svc/src/InboundServer/handlers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,4 +1245,4 @@ module.exports = {
12451245
'/ping': {
12461246
post: handlePostPing
12471247
},
1248-
};
1248+
};

modules/api-svc/src/lib/model/InboundTransfersModel.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ class InboundTransfersModel {
309309
log.push({ err }).error('Error in quoteRequest');
310310
const mojaloopError = await this._handleError(err);
311311
log.isInfoEnabled && log.push({ mojaloopError }).info(`Sending error response to ${sourceFspId}`);
312+
this.metrics.quoteGetResponseErrors.inc();
312313
return this._mojaloopRequests.putQuotesError(quoteRequest.quoteId, mojaloopError, sourceFspId, headers);
313314
}
314315
}
@@ -355,6 +356,7 @@ class InboundTransfersModel {
355356
*/
356357
async getQuoteRequest(quoteId, sourceFspId, headers) {
357358
try {
359+
this.metrics.quoteGetRequests.inc();
358360
// Get the quoteResponse data for the quoteId from the cache to be sent as a response to GET /quotes/{ID}
359361
const quoteResponse = await this._cache.get(`quoteResponse_${quoteId}`);
360362

@@ -366,6 +368,7 @@ class InboundTransfersModel {
366368
return await this._mojaloopRequests.putQuotesError(quoteId, mojaloopError, sourceFspId, headers);
367369
}
368370
// Make a PUT /quotes/{ID} callback to the source fsp with the quote response
371+
this.metrics.quoteGetResponseSends.inc();
369372
return this._mojaloopRequests.putQuotes(quoteId, quoteResponse, sourceFspId, headers);
370373
}
371374
catch(err) {

modules/api-svc/src/lib/model/OutboundTransfersModel.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ class OutboundTransfersModel {
226226
*/
227227
async initialize(data) {
228228
this.data = data;
229-
this.metrics.transferPrepares.inc(); // This increments the counter for each actual transfer
230229

231230
// add a transferId if one is not present e.g. on first submission
232231
if(!this.data.hasOwnProperty('transferId')) {
@@ -1508,4 +1507,4 @@ class OutboundTransfersModel {
15081507
}
15091508
}
15101509

1511-
module.exports = OutboundTransfersModel;
1510+
module.exports = OutboundTransfersModel;

0 commit comments

Comments
 (0)