JSR77 wants to provide a top down view of the JMS stats as shown in
the attached pdf page showing the JMSStats interface model:

JMSStats -> JMSConnectionStats[] -> JMSSessionStats[] -> {JMSProduerStats[], 
JMSConsumerStats[],
    messageCount, pendingMessageCount, expiredMessageCount, messageWaitTime{min, max, 
total},
    durableSubscriptionCount}

JMSProduerStats -> {name, messageCount, pendingMessageCount, expiredMessageCount,
    messageWaitTime{min, max, total}}
JMSConsumerStats -> {name, messageCount, pendingMessageCount, expiredMessageCount,
    messageWaitTime{min, max, total}}

We don't seem to have a real good representation of a session on the server.
I have looked at adding a basic connection/{producer/messageCount, 
consumer/messageCount} point
using the JMSDestinationManager addMessage and receive methods using something like:

   public void addMessage(ConnectionToken dc, SpyMessage val, Tx txId) throws 
JMSException
   {
      JMSDestination queue = (JMSDestination)destinations.get(val.getJMSDestination());
...
      // Update the client stats
      String destName = queue.getSpyDestination().getName();
      ClientStats stats = (ClientStats) clientStats.get(dc);
      if( stats != null )
      {
         stats.incProducerCount(destName);
      }
   }

   public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait) throws 
JMSException
   {
      ClientConsumer clientConsumer = getClientConsumer(dc);
      SpyMessage msg = clientConsumer.receive(subscriberId, wait);
      JMSDestination queue = (JMSDestination)destinations.get(msg.getJMSDestination());
      // Update the client stats
      String destName = queue.getSpyDestination().getName();
      ClientStats stats = (ClientStats) clientStats.get(dc);
      if( stats != null )
      {
         stats.incConsumerCount(destName);
      }
      return msg;
   }

which might be ok for an initial cut but it leaves a lot of seemingly difficult to 
gather wait
times. Any better ideas on how to provide more of this information?

xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx

Attachment: JMSStats.pdf
Description: Adobe PDF document

Reply via email to