IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > Create monitor models > Defining monitor details models

Defining stopwatches

Stopwatches are used to measure the time between two events. Stopwatches can be started, stopped, and reset by triggers or by the arrival of inbound events.

A running stopwatch shows the duration (elapsed time) since the point in time it was started. A stopped stopwatch shows the duration between the point in time it was started and the point in time it was stopped. The start and end times are defined by the value of the creationTime attribute included in the events that start and stop the stopwatch, so a stopwatch does not necessarily track the actual elapsed time between the arrival of the start and stop events. If a stopwatch is started or stopped by a time-based trigger (for example, a trigger that is tested once a minute), the system time of the Monitor server at the time that the trigger fired is used instead. To define a stopwatch:


Procedure

  1. Click the Monitor Details Model tab of the editor, right-click the monitoring context (or any element of the monitoring context) in the model tree, and click New > Stopwatch.

  2. In the Create New Stopwatch window, type a name into the Name field and click OK. The name is limited to 256 characters. As you type the name, a default ID is created for you, although you can change it if you prefer. The ID is required and must be unique within the monitoring context. The ID must be an XML NCName (non-colonized name), which means that it must start with a letter or underscore and that it can contain only letters, digits, underscores, hyphens, and periods.

    The stopwatch is added to the model tree under the monitoring context, and the form editor opens so that you can define the stopwatch.

  3. In the form editor, specify the details of the stopwatch as follows:

    1. Optional: Type a description in the Description field. The description is used only in the Monitor Model editor and is not displayed anywhere in Business Monitor. The character set is unrestricted.

    2. Select This stopwatch is an accumulating stopwatch if the stopwatch's trigger actions indicate the beginning and ending of activities that can be concurrent, and you want to measure their combined duration. If the stopwatch is accumulating, each start signal is interpreted as the beginning of a new activity with a duration to be measured, and each stop signal is interpreted as the end of such an activity. A non-accumulating stopwatch, however, ignores any start signals after it has been started and any stop signals after it has been stopped.

    3. If you want the stopwatch to be indexed in the database so that it can be used for sorting in Instances in the dashboards, select This stopwatch can be used for sorting. In the XML document, this option corresponds to the isSortable attribute of the stopwatch.

  4. To add triggers and actions to the table, click Add or double-click a row.

    1. Select an existing trigger or inbound event and click OK. The trigger or event is added to the table. You can select only triggers or inbound events that are defined in the same or a child monitoring context.

    2. Click the Resulting Action cell and select one of these actions: Start, Stop, or Reset. One of these actions, as described in the following table, will be performed when the inbound event arrives or the trigger fires.

      Action to be performed
      Action Description
      Start The stopwatch begins to count the elapsed time duration.
      Stop The stopwatch stops counting and keeps its value.

      If you start the stopwatch again, it begins counting by adding to the previous stored value.

      Reset The stopwatch sets its value to zero.

      The trigger and resulting action are added to the table. The items in the table are sorted based on the resulting action.

Defining monitor details models