[jboss-svn-commits] JBL Code SVN: r21089 - in labs/jbossesb/trunk/product/tools/jonplugin/src/main: resources/META-INF and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 17 14:50:29 EDT 2008


Author: tcunning
Date: 2008-07-17 14:50:29 -0400 (Thu, 17 Jul 2008)
New Revision: 21089

Modified:
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
Log:
bug:JBESB-668
Update plugin with bytes processed and failed.


Modified: labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java	2008-07-17 17:06:47 UTC (rev 21088)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java	2008-07-17 18:50:29 UTC (rev 21089)
@@ -32,7 +32,6 @@
 import org.rhq.core.domain.configuration.PropertySimple;
 import org.mc4j.ems.connection.bean.EmsBean;
 
-
 /**
  * @author Greg Hinkle
  */
@@ -42,14 +41,19 @@
     private static final String SUCCESS_PROCESSED = "messages successfully processed count";
     private static final String FAILED_PROCESSED = "messages failed count";
     private static final String PROCESSING_TIME = "processing time";
+    private static final String OVERALL_BYTES_PROCESSED = "bytes processed";
+    private static final String OVERALL_BYTES_FAILED = "bytes failed";
     
     private static final String SUCCESS_METRIC_NAME = "successProcessedCount";
     private static final String FAILED_METRIC_NAME = "failedProcessedCount";
     private static final String PROCESSINGTIME_METRIC_NAME = "processingTime";
+    private static final String BYTESPROCESSED_METRIC_NAME = "overallBytesProcessed";
+    private static final String BYTESFAILED_METRIC_NAME = "overallBytesFailed";
 
     @Override
     public void start(ResourceContext<MBeanResourceComponent> context) {
-        this.context = context;
+       	super.start(context); 
+	this.context = context;
         this.bean = context.getParentResourceComponent().getEmsBean();
     }
 
@@ -81,6 +85,14 @@
         		} else {
         			report.addData(new MeasurementDataNumeric(request, new Double(0)));
         		}
+        	} else if (metricName.equals(BYTESPROCESSED_METRIC_NAME)) {
+        		EmsAttribute attribute = this.bean.getAttribute(actionName + " " + OVERALL_BYTES_PROCESSED);
+        		Integer bytesProcessed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed.doubleValue())));
+        	} else if (metricName.equals(BYTESFAILED_METRIC_NAME)) {
+        		EmsAttribute attribute = this.bean.getAttribute(actionName + " " + OVERALL_BYTES_FAILED);
+        		Integer bytesProcessed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed.doubleValue())));        		
         	}
         }
     }

Modified: labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java	2008-07-17 17:06:47 UTC (rev 21088)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java	2008-07-17 18:50:29 UTC (rev 21089)
@@ -51,7 +51,7 @@
 	private static final String MESSAGES_SUCCESSFULLY_PROCESSED = "messages successfully processed count";
 	private static final String MESSAGES_FAILED_COUNT = "messages failed count";
 	private static final String MESSAGES_PROCESSED_TIME = "processing time";
-	
+	private static final String OVERALL_BYTES_PROCESSED = "overall bytes processed";
 	private static Log log = LogFactory.getLog(ActionDiscoveryComponent.class);
 	
 	protected ResourceContext<T> resourceContext;
@@ -60,7 +60,6 @@
 		this.resourceContext = context;
 	}
 	
-	
 	public AvailabilityType getAvailability() {
 		JMXComponent parent = resourceContext.getParentResourceComponent();
 		

Modified: labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	2008-07-17 17:06:47 UTC (rev 21088)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	2008-07-17 18:50:29 UTC (rev 21089)
@@ -41,12 +41,20 @@
 
     private static final String OVERALL_MESSAGE_COUNT = "overall service message count";    
     private static final String OVERALL_MESSAGE_METRIC = "overallMessageCount";
+   
+    private static final String OVERALL_BYTES_PROCESSED_METRIC = "overallBytesProcessed";
+    private static final String OVERALL_BYTES_FAILED_METRIC = "overallBytesFailed";
     
+    private static final String OVERALL_BYTES_PROCESSED = "overall bytes processed";
+    private static final String OVERALL_BYTES_FAILED = "overall bytes failed";
+
     @Override
     public void start(ResourceContext<MBeanResourceComponent> context) {
+        super.start(context);
         this.context = context;
     }
 
+
     @Override
     public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
     	Configuration pluginConfig = this.context.getPluginConfiguration();
@@ -57,6 +65,14 @@
         		EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_MESSAGE_COUNT);
         		Integer processed = (Integer) attribute.refresh();
         		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
+        	} else if (metricName.equals(OVERALL_BYTES_PROCESSED_METRIC)) {
+        		EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_PROCESSED);
+        		Integer processed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
+        	} else if (metricName.equals(OVERALL_BYTES_FAILED_METRIC)) {
+        		EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_FAILED);
+        		Integer processed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));        		
         	}
         }
     }

Modified: labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml	2008-07-17 17:06:47 UTC (rev 21088)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml	2008-07-17 18:50:29 UTC (rev 21089)
@@ -23,7 +23,7 @@
       </runs-inside>
 
       <plugin-configuration>
-         <c:simple-property name="objectName" readOnly="true" default="jboss.esb:deployment=%deployment%,type=esb"/>
+         <c:simple-property name="objectName" readOnly="true" default="jboss.esb:deployment=%deployment%"/>
          <c:simple-property name="nameTemplate" default="{deployment} JBoss ESB statistics"/>
          <c:simple-property name="descriptionTemplate" default="JBoss ESB statistics for the {deployment} deployment."/>
          <c:simple-property name="deployment" type="string" description="the JBoss ESB deployment name"/>
@@ -59,7 +59,9 @@
               <c:simple-property name="serviceName" type="string" description="the JBoss ESB service name"/>
          </plugin-configuration>
          <operation name="reset" displayName="Reset the message counter" description="Reset the message counter"/>
-         <metric displayName="Overall Service Message Count" property="overallMessageCount" category="throughput" displayType="summary" measurementType="trendsup" description="Overall Service Message Count"/> 
+         <metric displayName="Overall Service Message Count" property="overallMessageCount" category="throughput" displayType="summary" measurementType="trendsup" description="Overall Service Message Count"/>
+	 <metric displayName="Overall Service Bytes Processed" property="overallBytesProcessed" category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup" description="Overall Service Bytes Processed"/>
+	 <metric displayName="Overall Service Bytes Failed" property="overallBytesFailed" category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup" description="Overall Service Bytes Failed"/>
          <help>
              <![CDATA[
 	         JBoss ESB Service
@@ -75,6 +77,8 @@
          	     <c:simple-property name="descriptionTemplate" default="JBoss ESB statistics for the {actionName} action."/>
          		 <c:simple-property name="actionName" type="string" description="the JBoss ESB action name"/>
 			</plugin-configuration>
+	 	<metric displayName="Bytes Processed" property="overallBytesProcessed" category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup"/>
+		<metric displayName="Bytes Failed" property="overallBytesFailed" category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup"/>
 	        <metric displayName="Messages Successfully Processed" property="successProcessedCount" category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup"/>
 	        <metric displayName="Messages Failed" property="failedProcessedCount"  category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup"/>
 	        <metric displayName="Processing Time" property="processingTime" displayType="summary" defaultOn="true" category="performance"/>




More information about the jboss-svn-commits mailing list