MojitoPerf Class
Item Index
Methods
dump
()
Array
private
Dumps all marks and timeline entries into the console. This method is meant to be called automatically when a request ends. You can target specific metrics by using the configuration:
"perf": { "include": { "mojito-action-context": true } }
Or just exclude some of them by doing:
"perf": { "exclude": { "mojito-action-context": true } }
Returns:
idFromCommand
-
command
Produces an ID to identify the timeline or mark based on a command object.
Parameters:
-
commandObjectObject that represent the command to invoke.
Returns:
instrumentMojitoRequest
-
req -
res
Instruments requests that will be processed by mojito core, providing a valid timeline for that request, and allowing to instrument some other relative processes, and grouping them per request to facilitate analysis. This method is responsible for calling "dump".
Parameters:
-
reqObjectthe request object from express.
-
resObjectthe response object from express.
mark
-
group -
label -
msg -
id
Sets a mark in the request timeline. All marks will be flushed after the end. This is useful to measure when a particular process start or end with respect to the request timeline.
Parameters:
-
groupStringEvent group.
-
labelStringEvent identifier. Will be combined with group.
-
msgStringDescription of the mark.
-
idString | ObjectUnique identifier of the mark, usually the requestId or a command object.
Returns:
timeline
-
group -
label -
msg -
id
Starts a timeline metric, providing a way to call it done at some point in the future. This is useful to measure the time to execute a process in mojito.
Parameters:
-
groupStringEvent group.
-
labelStringEvent identifier. Will be combined with group.
-
msgStringDescription of the mark.
-
idStringUnique identifier of the mark, usually the requestId or the yuid().
Returns:
timeline
-
group -
label -
msg -
id
Starts a timeline metric, providing a way to call it done at some point in the future. This is useful to measure the time to execute a process in mojito.
Parameters:
-
groupStringEvent group.
-
labelStringEvent identifier. Will be combined with group.
-
msgStringDescription of the mark.
-
idStringUnique identifier of the mark, usually the requestId or the yuid().
