The default interval for collecting overall server statistics is 1 second. You may wish to view average system usage statistics over a larger interval. The server_rate_interval configuration parameter controls the collection interval for server statistics. The parameter can be set in the configuration file or dynamically using the
set server command. This parameter can only be set to positive integers greater than zero.
The statistics parameter allows you to globally enable and disable statistic gathering. Statistics are kept in server memory for the life of each object. If you wish to reset the total statistics for all objects to zero, disable statistic gathering, then re-enable it. Server statistics are also reset when the server shuts down and restarts, or in the event of a fault-tolerant failover.
The rate of incoming/outgoing messages and message size is calculated over an interval. By default, the average is calculated every 3 seconds. You can increase or decrease this value by altering the rate_interval parameter. This parameter can be set in the configuration file or dynamically using the
set server command. Setting this parameter to 0 disables the tracking of statistics over an
interval—only the total statistics for the destination, route, producer, or consumer are kept.
To enable detailed statistics, set the detailed_statistics parameter to the type of statistics you wish to receive. The parameter can have the following values:
You can set the detailed_statistics parameter to
NONE or any combination of
CONSUMERS,
PRODUCERS,
ROUTES, or
CHANNELS. To specify more than one type of detailed statistic gathering, provide a comma-separated list of values. You can set the
detailed_statistics parameter in the configuration file or dynamically by using the
set server command. For example, the following
set server command enables detailed statistic tracking for producers and routes.
The statistics_cleanup_interval parameter controls how long detailed statistics are kept. This parameter can be set either in the configuration file or dynamically with the
set server command. By default, statistics are kept for 15 seconds. For example, if there is a topic subscriber for the topic
foo.*, and the subscriber receives a message on topic
foo.bar, if no new messages arrive for topic
foo.bar within 15 seconds, statistics for topic
foo.bar are deleted for that consumer. You can set this parameter to 0 to signify that all detailed statistics are to be kept indefinitely. Of course, statistics for an object only exist as long as the object itself exists. That is, if a message consumer terminates, all detailed statistics for that consumer are deleted from memory.
The max_stat_memory parameter controls the amount of memory used by detailed statistics. This parameter can be set either in the configuration file or dynamically with the
set server command. By default, this parameter is set to 0 which signifies that detailed statistics have no memory limit. If no units are specified, the value of this parameter is in bytes. Optionally, you can specify units as KB, MB, or GB. When the specified limit is reached, the server stops collecting new statistics. The server will only resume collecting statistics if the amount of memory used decreases (for example, if the
statistics_cleanup_interval is set and old statistics are removed).
The show stat command allows you to filter the statistics based on destination name, user name, connection ID, or any combination of criteria. You can optionally specify the
total keyword to retrieve only the total statistics (this suppresses the detailed output). You can also optionally specify the
"wide" keyword when displaying statistics for destinations or routes. This specifies that inbound and outbound message statistics should be displayed on the same line (the line can be 100 characters or more).
See show stat on page 170 for more information and detailed syntax of the show stat command.