1 18 package org.apache.activemq.console.command; 19 20 import java.util.List ; 21 import java.util.Iterator ; 22 import java.util.ArrayList ; 23 24 public class BstatCommand extends QueryCommand { 25 30 protected void runTask(List tokens) throws Exception { 31 List queryTokens = new ArrayList (); 32 String brokerName = "*"; 34 for (Iterator i = tokens.iterator(); i.hasNext();) { 35 String token = (String )i.next(); 36 if (!token.startsWith("-")) { 37 brokerName = token; 38 break; 39 } else { 40 queryTokens.add(token); 42 } 43 } 44 45 queryTokens.add("--objname"); 47 queryTokens.add("Type=*,BrokerName=" + brokerName); 48 queryTokens.add("-xQTopic=ActiveMQ.Advisory.*"); 49 queryTokens.add("--vuew"); 50 queryTokens.add("Type,BrokerName,Destination,ConnectorName,EnqueueCount," + 51 "DequeueCount,TotalEnqueueCount,TotalDequeueCount,Messages," + 52 "TotalMessages,ConsumerCount,TotalConsumerCount,DispatchQueueSize"); 53 54 super.runTask(queryTokens); 56 } 57 58 protected String [] helpFile = new String [] { 59 "Task Usage: activemq-admin bstat [bstat-options] [broker-name]", 60 "Description: Performs a predefined query that displays useful statistics regarding the specified broker.", 61 " If no broker name is specified, it will try and select from all registered brokers.", 62 "", 63 "Bstat Options:", 64 " --jmxurl <url> Set the JMX URL to connect to.", 65 " --version Display the version information.", 66 " -h,-?,--help Display the query broker help information.", 67 "", 68 "Examples:", 69 " activemq-admin bstat localhost", 70 " - Display a summary of statistics for the broker 'localhost'" 71 }; 72 } 73 | Popular Tags |