Sun GlassFish Message Queue 4.4 Developer's Guide for Java Clients

Format of Metrics Messages

In order to consume and process a metrics messages, you must know its type and format. This section describes the general format of metrics messages and provides detailed information on the format of each type of metrics message.

Metrics messages are of type MapMessage. (A type of message whose body contains a set of name-value pairs. The order of entries is not defined.)

Note that the names of name-value pairs (used in code to extract data) are case-sensitive and must be coded exactly as shown. For example, NumMsgsOut is incorrect; numMsgsOut is correct.

Broker Metrics

The messages you receive when you subscribe to the topic mq.metrics.broker have the type property set to mq.metrics.broker in the message header and have the data listed in Table 4–2 in the message body.

Table 4–2 Data in the Body of a Broker Metrics Message

Metric Name 

Value Type 

Description 


numConnections

long 

Current number of connections to the broker 


numMsgsIn 

long 

Number of JMS messages that have flowed into the broker since it was last started 


numMsgsOut

long 

Number of JMS messages that have flowed out of the broker since it was last started 


numMsgs

long 

Current number of JMS messages stored in broker memory and persistent store 


msgBytesIn

long 

Number of JMS message bytes that have flowed into the broker since it was last started 


msgBytesOut

long 

Number of JMS message bytes that have flowed out of the broker since it was last started 


totalMsgBytes

long 

Current number of JMS message bytes stored in broker memory and persistent store 


numPktsIn

long 

Number of packets that have flowed into the broker since it was last started; this includes both JMS messages and control messages 


numPktsOut

long 

Number of packets that have flowed out of the broker since it was last started; this includes both JMS messages and control messages 


pktBytesIn 

long 

Number of packet bytes that have flowed into the broker since it was last started; this includes both JMS messages and control messages 


pktBytesOut

long 

Number of packet bytes that have flowed out of the broker since it was last started; this includes both JMS messages and control messages 


numDestinations

long 

Current number of destinations in the broker 

JVM Metrics

The messages you receive when you subscribe to the topic mq.metrics.jvm have the type property set to mq.metrics.jvm in the message header and have the data listed in Table 4–3 in the message body.

Table 4–3 Data in the Body of a JVM Metrics Message

Metric Name 

Value Type 

Description 


freeMemory

long 

Amount of free memory available for use in the JVM heap 


maxMemory

long 

Maximum size to which the JVM heap can grow 


totalMemory

long 

Total memory in the JVM heap 

Destination-List Metrics

The messages you receive when you subscribe to a topic named mq.metrics.destination_list have the type property set to mq.metrics.destination_list in the message header.

The message body contains a list of map names. Each destination on the broker is specified by a unique map name (a name-value pair) in the message body. The type of the name-value pair is hashtable.

The name (in the name-value pair) depends on whether the destination is a queue or a topic, and is constructed as follows:

The value (in the name-value pair) is an object of type java.util.Hashtable . This hashtable contains the key-value pairs described in Table 4–4.

Table 4–4 Value of a Name-Value Pair

Key (String)

Value Type

Value or Description

name

String 

Destination name 

type

String 

Destination type (queue or topic)

isTemporary

Boolean 

Is destination temporary? 

Notice that the destination name and type could be extracted directly from the metrics topic destination name, but the hashtable includes it for your convenience.

By enumerating through the map names and extracting the hashtable described in Table 4–4, you can form a complete list of destination names and some of their characteristics.

The destination list does not include the following kinds of destinations:

Destination Metrics

The messages you receive when you subscribe to the topic mq.metrics.destination.queue.monitored_destination_name have the type property mq.metrics.destination.queue.monitored_destination_name set in the message header. The messages you receive when you subscribe to the topic mq.metrics.destination.topic.monitored_destination_name have the type property mq.metrics.destination.topic. monitored_destination_name set in the message header. Either of these messages has the data listed in Table 4–5 in the message body.

Table 4–5 Data in the Body of a Destination Metrics Message

Metric Name 

Value Type 

Description 


numActiveConsumers

long 

Current number of active consumers 


avgNumActiveConsumers 

long 

Average number of active consumers since the broker was last started 


peakNumActiveConsumers 

long 

Peak number of active consumers since the broker was last started 


numBackupConsumers 

long 

Current number of backup consumers (applies only to queues) 


avgNumBackupConsumers

long 

Average number of backup consumers since the broker was last started (applies only to queues) 


peakNumBackupConsumers

long 

Peak number of backup consumers since the broker was last started (applies only to queues) 


numMsgsIn

long 

Number of JMS messages that have flowed into this destination since the broker was last started 


numMsgsOut 

long 

Number of JMS messages that have flowed out of this destination since the broker was last started 


numMsgs

long 

Number of JMS messages currently stored in destination memory and persistent store 


avgNumMsgs

long 

Average number of JMS messages stored in destination memory and persistent store since the broker was last started 


peakNumMsgs 

long 

Peak number of JMS messages stored in destination memory and persistent store since the broker was last started 


msgBytesIn

long 

Number of JMS message bytes that have flowed into this destination since the broker was last started 


msgBytesOut

long 

Number of JMS message bytes that have flowed out of this destination since the broker was last started 


totalMsgBytes

long 

Current number of JMS message bytes stored in destination memory and persistent store 


avgTotalMsgBytes

long 

Average number of JMS message bytes stored in destination memory and persistent store since the broker was last started 


peakTotalMsgBytes

long 

Peak number of JMS message bytes stored in destination memory and persistent store since the broker was last started 


peakMsgBytes

long 

Peak number of JMS message bytes in a single message since the broker was last started 


diskReserved

long 

Disk space (in bytes) used by all message records (active and free) in the destination file-based store 


diskUsed

long 

Disk space (in bytes) used by active message records in destination file-based store 


diskUtilizationRatio

int 

Quotient of used disk space over reserved disk space. The higher the ratio, the more the disk space is being used to hold active messages