All help topics · Link to this topic
Showing help on 'finished_tasks()'
Syntax: finished_tasks () => LISTWhen enabled (via SAVE_FINISHED_TASKS in options.h), the server will keep track of the execution time of every task that passes through the interpreter. This built-in is registered only in builds with SAVE_FINISHED_TASKS enabled. The programmer must be a wizard, or E_PERM is raised. This data is then made available to the database in two ways.
The first is the finished_tasks() function. This function will return a list of maps of the last several finished tasks (configurable via $server_options.finished_tasks_limit) with the following information:
Foreground: True if this was a foreground task.
Fullverb: The full name of the verb being executed.
Object: The object the verb is defined on.
Player: The result of the 'player' variable.
Programmer: The player whose permissions the verb is running as.
Receiver: The object that received the verb invocation. In the case of primitives, this is the primitive's object handler.
Suspended: True if the task suspended instead of finishing.
This: The result of the 'this' variable.
Time: The total time the task took inside the interpreter.
Verb: The verb name used to invoke the task.
The second is via the $handle_lagging_task verb. When the execution threshold defined in $server_options.task_lag_threshold is exceeded, the server will write an entry to the log file and call the $handle_lagging_task verb with the call stack of the task as well as the execution time.