Types of Accounting & Statistics

IBM MQ Accounting and Statistics are not the same thing. While they may provide a similar set of counts when you view the data they provide, they each serve a different purpose.

Accounting Statistics
Recorded At MQDISC time
Periodically for long running connections
Periodically
Interval DISPLAY QMGR ACCTINT DISPLAY QMGR STATINT
Content One Record for each application
Contains data for each queue the application opened
One Record for each queue
Contains accumulated data for all applications using that queue

Assuming that applications are long running, then both accounting and statistics records are provided on an interval that you can set. However, accounting information will also be written for an application at MQDISC time. This therefore means that if your applications make short-lived connections, you will see more records, and that they will be created at seemingly random times rather than on a regular drum-beat.

The interval used to write out accounting information from long-running applications is queue manager attribute ACCTINT, and for statistics information it’s queue manager attribute STATINT.

The main difference between statistics and accounting is the perspective of the data. Statistics data is collected for the queue as a whole, the channel as a whole or the queue manager as a whole (in the case of MQI statistics). Accounting data is collected for each individual application.

The are five different types of accounting and statistics data, as shown in the table below. Each can be enabled/disabled independently of the others, so you can collect only what you need. Additionally, for data that is per queue or channel, you can enable/disable it on a per object basis.

Type Enablement
MQI Accounting ALTER QMGR ACCTMQI(ON|OFF)
 
This data contains counts of all the API calls made by each application. Each application is identified by name and user id, along with client fields if it is a client connected application.
Queue Accounting ALTER QMGR ACCTQ(ON|OFF|NONE)
ALTER QLOCAL(Q1) ACCTQ(ON|OFF|QMGR)
 
The data contains counts of the messaging done on each queue, by application. The application is identified in the record, and then each queue it is used is recorded with messaging counts, and data sizes.
Channel Statistics

ALTER QMGR STATCHL(LOW|MEDIUM|HIGH|OFF|NONE)
STATACLS(LOW|MEDIUM|HIGH|OFF|QMGR)

ALTER CHL(CHL1) STATCHL(LOW|MEDIUM|HIGH|OFF|QMGR)

 
The data contains identifying information about the channel and it’s remote partner, and details about how the channel is performing, with message counts, exit and network expense, and batch sizes.
MQI Statistics ALTER QMGR STATMQI(ON|OFF)
 
This data contains counts of all the API calls made across the whole queue manager.
Queue Statistics ALTER QMGR STATQ(ON|OFF|NONE)
ALTER QLOCAL(Q1) STATQ(ON|OFF|QMGR)
 
This data contains counts of the puts and gets made against the queue as a whole, as well as handy things like high and low watermarks and numbers of expired messages.

Of course the best way to get a handle on what these data outputs from the queue manager can give you, is to try them out.

The team at MQGem would love to hear what you think. Leave your comments here.

This site uses Akismet to reduce spam. Learn how your comment data is processed.