Understanding the service timer
Queue service interval events use an internal timer, called the service timer, which is controlled by the queue manager. The service
timer is used only if one or other of the queue service interval events is
enabled.
- What precisely does the service timer measure?
- The service timer measures the elapsed time between an MQPUT call to
an empty queue or a get operation, and the next put or get, provided the queue
depth is nonzero between these two operations.
- When is the service timer active?
- The service timer is always active (running), if the queue has messages
on it (depth is nonzero) and a queue service interval event is enabled. If
the queue becomes empty (queue depth zero), the timer is put into an OFF state,
to be restarted on the next put.
- When is the service timer reset?
- The service timer is always reset after a get operation. It is also reset by an MQPUT call to an empty queue. However, it is
not necessarily reset on a queue service interval event.
- How is the service timer used?
- Following a get operation or an MQPUT call, the queue
manager compares the elapsed time as measured by the service timer, with the
user-defined service interval. The result of this comparison is that:
- An OK event is generated if there is a get operation and
the elapsed time is less than or equal to the service interval, AND this event
is enabled.
- A high event is generated if the elapsed time is greater than the service
interval, AND this event is enabled.
- Can applications read the service timer?
- No, the service timer is an internal timer that is not available to
applications.
- What about the TimeSinceReset parameter?
- The TimeSinceReset parameter is returned as
part of the event statistics in the event data. It specifies the time between
successive queue service interval events, unless the event statistics are
reset.