This solution provides means to log which task was started and how long it took. Tracing of tasks can be important for finding out who uses certain tasks and performance tuning. The result will become available in a list like this:
This solution consists of Dynamic Model code for creating the a table task_trace. Also, a control procedure is provided, with two templates. The first template records the start of the task. The second records the end of the task and write the result to table task_trace. The templates will be automatically added to all tasks.
This code creates table task_trace.
This control procedure code adds the two templates to every task (of type STORED PROCEDURE).
This template starts measuring the duration of the task.
This template finishes measuring the duration of the task and stores the result in table task_trace.
In the attachment you will find all code of this solution.