Trace which task was started and how long it took to complete


Goal

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:

 

 

Solution

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.

Dynamic model create_task_trace

This code creates table task_trace.

Control procedure fill_task_trace

This control procedure code adds the two templates to every task (of type STORED PROCEDURE).

Template fill_task_trace_start

This template starts measuring the duration of the task.

Template fill_task_trace_end

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.


0 replies

Be the first to reply!

Reply