I was using the mid-range accounting information to draw graphs of usage, and I found I was missing some data.
There is a “Collect Accounting” Time for every queue every ACCTINT seconds (default 1800 seconds = 30 minutes). After this time, any MQ activity will cause the accounting record to be produced. This does not mean you get records every half hour as you do on z/OS, it means you get records with a minimum interval of 30 minutes for long running tasks.
I had a server which got from its input queue and put a reply message to the reply-to-queue.
Every minutes an application started once a minute which put messages to this server, got the replies and ended.
When are the records produced?
Accounting data is produced (if collecting is enabled) when:
- an MQDISC is issued, either explicitly implicitly
- for long running tasks the accounting record(s) seems to be produced at when the current time is past the “Collect Accounting time”, when there has been some MQ activity. For example there were accounting records for a server at the following times
- The queue manager was started at 12:35:51, and the server started soon afterwards
- 12:36:04 to 13:06:33. An application put a message to the server queue and got the response back. This is 27 seconds after the half hour
- 13:06:33 to 13:36:42 The application had been putting messages to the server and getting the responses back. This is 6 seconds after the half hour
- 13:36:42 to 14:29:48 this interval is 57 minutes. The server did no work from 1400 to 14:29:48 ( as I was having my lunch). At 14:29:48 a message arrived, and the accounting record was written for the server.
- 14:29:48 to 15:00:27 during this time messages were being processed, the interval is just over the 30 minutes.
What does this mean?
- If you want accounting data with an interval “on the half hour”, you need to start your queue manager “just before the half hour”.
- Data may not be in the time period you expect. If you have accounting record produced at 1645, the data collected between 1645 and 17:14 may not appear until the first message is processed the next day. The record havean interval from 16:45 to 09:00:01 the next day. You may not want to display averages if the interval is longer than 45 minutes.
- You may want to stop and restart the servers every night to have the accounting data in the correct day.