> Working with Server Statistics
> The TIBCO Enterprise Message Service server allows you to track incoming and outgoing message volume, message size, and message statistics for the server overall as well as for each producer, consumer, or route. You can configure the type of statistics collected, the interval for computing averages, and amount of detail for each type.
> Statistic tracking can be set in the server’s configuration file, or you can change the configuration dynamically using commands in the administration tool or by creating your own application with the administration APIs.
> Statistics can be viewed using the administration tool, or you can create your own application that performs more advanced analysis of statistics using the administration APIs.
> This section details how to configure and view statistics using the configuration files and administration tool commands. For more information about the administration APIs, see the description of com.tibco.tibjms.admin in the online documentation.

> | The TIBCO Enterprise Message Service server tracks the number of incoming or outgoing messages, but only messages sent or received by a producer, consumer, or route are tracked. The server also sends system messages, but these are not included in the number of messages. However, the server can add a small amount of data to a message for internal use by the server. This overhead is counted in the total message size, and you may notice that some messages have a greater message size than expected.

> Overall Server Statistics
> The server always collects certain overall server statistics. This includes the rate of inbound and outbound messages (expressed as number of messages per second), message memory usage, disk storage usage, and the number of destinations, connections, and durable subscriptions. Gathering this information consumes virtually no system resources, therefore these statistics are always available. You can view overall server statistics by executing the show server command.
> 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.
> Enabling Statistic Gathering
> Each producer, consumer, destination, and route can gather overall statistics and statistics for each of its destinations. To enable statistic gathering, you must set the statistics parameter to enabled. This parameter can be specified in the configuration file, and it can be changed dynamically using the set server command.
> 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.
> For each producer, consumer, destination, and route the total number of sent/received messages and total size of messages is maintained. Also, producers and consumers keep these statistics for each destination that they use to send or receive messages.
> 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.
> Gathering total statistics for producers, consumers, destinations, and routes consumes few system resources. Under most circumstances, enabling statistic gathering and average calculations should not affect system performance.
> Detailed Statistics
> In some situations, the default statistic gathering may not be sufficient. For example, if a topic subscriber subscribes to wildcard topics, the total statistics for all topics that match the wildcard are kept. You may wish to get further detail in this case and track the statistics for each actual topic the subscriber receives.
> The following situations may require detailed statistic gathering:

> ● | Topic subscribers that subscribe to wildcard topics

> ● | Message producers that do not specify a destination when they are created. These message producers can produce messages for any destination, and the destination name is specified when a message is sent.

> ● | Routes can have incoming and outgoing messages on many different topics.

> ● | Channels can also have outgoing messages on many different topics.

> 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:

> ● | NONE — disables detailed statistic gathering.

> ● | CONSUMERS — enables detailed statistics for topic subscribers with wildcard topic names.

> ● | PRODUCERS — enables detailed statistics for producers that do not specify a destination when they are created.

> ● | ROUTES — enables detailed statistics for routes.

> ● | CHANNELS — enables detailed statistics for channels.

> 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.
> set server detailed_statistics = PRODUCERS,ROUTES
> Collecting detailed statistics does consume memory, and can adversely affect performance when gathering a high volume of statistics. There are two parameters that allow you to control resource consumption when collecting detailed statistics. First, you can control the amount of time statistics are kept, and second you can set a maximum amount of memory for detailed statistic gathering. When application programs create many dynamic destinations, we recommend against gathering detailed statistics.
> 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).
> Displaying Statistics
> When statistic collecting is enabled, you can view statistics for producers, consumers, routes, and destinations using the show stat command in the administration tool.
> 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).
> The following illustrates displaying statistics for a route where detailed statistic tracking is enabled.
> tcp://server1:7322> show stat route B
> Inbound statistics for route 'B':
> Total Count Rate/Second
> Destination Msgs Size Msgs Size
> <total> 189 37.9 Kb 10 2.0 Kb
> Topic: dynamic.0 38 7.6 Kb 2 0.4 Kb
> Topic: dynamic.1 38 7.6 Kb 2 0.4 Kb
> Topic: dynamic.2 38 7.6 Kb 2 0.4 Kb
> Topic: dynamic.3 38 7.6 Kb 2 0.4 Kb
> Topic: dynamic.4 37 7.4 Kb 2 0.4 Kb
> Outbound statistics for route 'B':
> Total Count Rate/Second
> Destination Msgs Size Msgs Size
> <total> 9538 1.9 MB 10 2.1 Kb
> Topic: dynamic.0 1909 394.9 Kb 2 0.4 Kb
> Topic: dynamic.1 1908 394.7 Kb 2 0.4 Kb
> Topic: dynamic.2 1907 394.5 Kb 2 0.4 Kb
> Topic: dynamic.3 1907 394.5 Kb 2 0.4 Kb
> Topic: dynamic.4 1907 394.5 Kb 2 0.5 Kb
> See show stat on page 152 for more information and detailed syntax of the show stat command.

Copyright © TIBCO Software Inc. All Rights Reserved.