Measuring the runtime of script actions


The runtime of the script actions in todo4teams should always be short, because most of the time (as with start, takeover or end actions), the user expects to complete the action before he can continue to operate the todo4teams client.

To see how long it takes to run your scripts, you can easily run time measurements and later view minimum, maximum, and average runtimes.

Please note: This measurement method of the runtime only works in the server-side scripts (e-mail scripts, start, takeover and end scripts).

To do this, add the following lines of code to your script:

// start the stopwatch and set it's name:
var mon = com.jamonapi.MonitorFactory.start("Email forward in end script");

try{
  // ...
}
catch(e){
  // ...
}
// stop the stopwatch:
mon.stop();

Here mon is a monitor object that works like a stopwatch. With the generation this will be started automatically and gets a name (here: "Email forward in end script").

The line mon.stop () ends the measurement.

To read out the measurements please log-in to the web frontend for administrators. Switch to the tab "Monitor" and look for the name you gave in the list of measurements (in the example "Email forward in end script"):

Unbenannt.png

 

     

Child Pages