Skip to content
Snippets Groups Projects
Commit f41b34ce authored by Cédric Moreau's avatar Cédric Moreau
Browse files

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

parent 227bfa79
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,10 @@ export const MonitorExecutionTime = function (idProperty?: string) { ...@@ -53,7 +53,10 @@ export const MonitorExecutionTime = function (idProperty?: string) {
const start = getMicrosecondsTime() const start = getMicrosecondsTime()
const entities: any[] = await original.apply(this, args) const entities: any[] = await original.apply(this, args)
const duration = getDurationInMicroSeconds(start) 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]) { if (!monitorings[k]) {
monitorings[k] = { monitorings[k] = {
times: [] times: []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment