[jboss-svn-commits] JBL Code SVN: r24810 - labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jan 19 21:57:30 EST 2009


Author: tcunning
Date: 2009-01-19 21:57:30 -0500 (Mon, 19 Jan 2009)
New Revision: 24810

Modified:
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
Log:
JBESB-2294
Make sure bytes are long.


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	2009-01-20 02:56:47 UTC (rev 24809)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	2009-01-20 02:57:30 UTC (rev 24810)
@@ -43,10 +43,12 @@
     private static final String OVERALL_MESSAGE_METRIC = "overallMessageCount";
    
     private static final String OVERALL_BYTES_METRIC = "overallBytes";
+    private static final String OVERALL_BYTES_COUNT = "overall service count bytes";
+    
     private static final String OVERALL_BYTES_PROCESSED_METRIC = "bytesProcessed";
     private static final String OVERALL_BYTES_FAILED_METRIC = "bytesFailed";
     
-    private static final String OVERALL_BYTES_PROCESSED = "overall bytes processed";
+    private static final String OVERALL_BYTES_PROCESSED = "overall processedbytes";
     private static final String OVERALL_BYTES_FAILED = "overall bytes failed";
 
     private static final String OVERALL_MINUTE_METRIC_NAME = "overallMessageCountByMinute";
@@ -63,8 +65,8 @@
     	pluginConfig.put(new PropertySimple("type", "service"));
     	Integer overallMessages = new Integer(0);
     	
-    	int bytesProcessed = 0;
-    	int bytesFailed = 0;
+    	long bytesProcessed = 0;
+    	long bytesFailed = 0;
         for (MeasurementScheduleRequest request : requests) {
         	String metricName = request.getName();
         	if (metricName.equals(OVERALL_MESSAGE_METRIC)) {
@@ -73,20 +75,27 @@
         		report.addData(new MeasurementDataNumeric(request, new Double(overallMessages.doubleValue())));
         	} else if (metricName.equals(OVERALL_BYTES_PROCESSED_METRIC)) {
         		EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_PROCESSED);
-        		Integer processed = new Integer(0);
+        		Long processed = new Long(0);
         		if (attribute != null) {
-        			processed = (Integer) attribute.refresh();
-        			bytesProcessed = processed.intValue();
+        			processed = (Long) attribute.refresh();
+        			bytesProcessed = processed.longValue();
         		}
         		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 = new Integer(0);
+        		Long processed = new Long(0);
         		if (attribute != null) {
-        			processed = (Integer) attribute.refresh();
-        			bytesFailed = processed.intValue();
+        			processed = (Long) attribute.refresh();
+        			bytesFailed = processed.longValue();
         		}
         		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));        		
+        	} else if (metricName.equals(OVERALL_BYTES_METRIC)) {
+        		EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_BYTES_COUNT);
+        		Long processed = new Long(0);
+        		if (attribute != null) {
+        			processed = (Long) attribute.refresh();
+        		}
+        		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
         	}
         }
 
@@ -94,8 +103,6 @@
         	String metricName = request.getName();
         	if (metricName.equals(OVERALL_MINUTE_METRIC_NAME)) {
         		report.addData(new MeasurementDataNumeric(request, new Double(overallMessages.doubleValue())));
-        	} else if (metricName.equals(OVERALL_BYTES_METRIC)) {
-        		report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed + bytesFailed)));
         	}
         }
     }




More information about the jboss-svn-commits mailing list