diff --git a/lib/MonitorExecutionTime.ts b/lib/MonitorExecutionTime.ts index b6216f8812511a186584cad20c8e3e30bca09d12..071126741d1aa6a008aac1d5cf56067058213153 100644 --- a/lib/MonitorExecutionTime.ts +++ b/lib/MonitorExecutionTime.ts @@ -53,7 +53,10 @@ export const MonitorExecutionTime = function (idProperty?: string) { const start = getMicrosecondsTime() const entities: any[] = await original.apply(this, args) const duration = getDurationInMicroSeconds(start) - const k = target.constructor.name + '.' + propertyKey + (idProperty ? `[${(this as any)[idProperty]}]` : '') + const k = propertyKey === 'getFromCacheOrDB' + ? target.constructor.name + '.<>' + args[0] + '(' + args[1] + ')' + : target.constructor.name + '.' + propertyKey + (idProperty ? `[${(this as any)[idProperty]}]` : ''); + // const k = target.constructor.name + '.' + propertyKey + (idProperty ? `[${(this as any)[idProperty]}]` : '') if (!monitorings[k]) { monitorings[k] = { times: [] diff --git a/lib/main.js b/lib/main.js index d6920fb60c7022023998449d51338c1ef833b2af..b35fd742b5e41378b96afcd6d44d87b0cec298ee 100755 --- a/lib/main.js +++ b/lib/main.js @@ -45,7 +45,7 @@ module.exports = (duniterServer, host, port, appParente, program) => co(function }; // Confirm started - console.log("module currency-monit started"); + console.log(`module currency-monit started at ${new Date()}`); // Specialized node's UI let httpServer = webserver(host, port, appParente, duniterServer, monitDatasPath, offset, cache, program.resetData);