Commit f41b34ce authored by Cédric Moreau's avatar Cédric Moreau

[mod] `@MonitorExecutionTime` => subdivide getFromCacheOrDB calls

parent 227bfa79
......@@ -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: []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment