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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Sep 28 23:05:43 EDT 2008


Author: tcunning
Date: 2008-09-28 23:05:43 -0400 (Sun, 28 Sep 2008)
New Revision: 23157

Modified:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
Log:
JBESB-2043
Add more overall totals.


Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java	2008-09-29 02:50:21 UTC (rev 23156)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java	2008-09-29 03:05:43 UTC (rev 23157)
@@ -45,14 +45,20 @@
     private static final String PROCESSING_TIME = "processing time";
     private static final String OVERALL_BYTES_PROCESSED = "processed bytes";
     private static final String OVERALL_BYTES_FAILED = "failed bytes";
-
+    
     private static final String OVERALL_METRIC_NAME = "overallMessagesCount";
     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 OVERALL_BYTES_METRIC_NAME = "overallBytesProcessed";
+    private static final String BYTESPROCESSED_METRIC_NAME = "bytesSuccessful";
     private static final String BYTESFAILED_METRIC_NAME = "overallBytesFailed";
 
+    private static final String OVERALL_MINUTE_METRIC_NAME = "overallMessagesCountMinute";
+    private static final String SUCCESS_MINUTE_METRIC_NAME = "successProcessedCountMinute";
+    private static final String FAILED_MINUTE_METRIC_NAME = "failedProcessedCountMinute";
+    
     /**
      * Is this service alive?
      *
@@ -101,6 +107,11 @@
         //Object entityStatistics = operation.invoke(context.getResourceKey());
 
     	int counter = 0;
+    	int success = 0;
+    	int failed = 0;
+    	
+    	int counterBytesFailed = 0;
+    	int counterBytesProcessed = 0;
     	for (MeasurementScheduleRequest request : requests) {
         	String metricName = request.getName();
         	if (metricName.equals (SUCCESS_METRIC_NAME)) {
@@ -109,6 +120,7 @@
         		if (attribute != null) {
         			processed = (Integer) attribute.refresh();
         		}
+        		success = processed.intValue();
         		counter += processed.intValue();
         		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
         	} else if (metricName.equals(FAILED_METRIC_NAME)) {
@@ -117,6 +129,7 @@
         	    if (attribute != null) {
         	    	processed = (Integer) attribute.refresh();
         	    }
+        	    failed = processed.intValue();
         	    counter += processed.intValue();
         		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
         	} else if (metricName.equals(PROCESSINGTIME_METRIC_NAME)) {
@@ -133,21 +146,31 @@
         		Integer bytesProcessed = new Integer(0);
         		if (attribute != null) {
         			bytesProcessed = (Integer) attribute.refresh();
+        			counterBytesProcessed = bytesProcessed.intValue();
         		}
         		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 = new Integer(0);
+        		Integer bytesFailed = new Integer(0);
         		if (attribute != null) {
-        			bytesProcessed = (Integer) attribute.refresh();
+        			bytesFailed = (Integer) attribute.refresh();
+        			counterBytesFailed += bytesFailed.intValue();
         		}
-        		report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed.doubleValue())));        		
+        		report.addData(new MeasurementDataNumeric(request, new Double(bytesFailed.doubleValue())));        		
         	}
         }
     	for (MeasurementScheduleRequest request : requests) {
         	String metricName = request.getName();
         	if (metricName.equals (OVERALL_METRIC_NAME)) {
         		report.addData(new MeasurementDataNumeric(request, new Double(counter)));        		
+        	} else if (metricName.equals(OVERALL_MINUTE_METRIC_NAME)) {
+        		report.addData(new MeasurementDataNumeric(request, new Double(counter)));        		
+        	} else if (metricName.equals(SUCCESS_MINUTE_METRIC_NAME)) {
+        		report.addData(new MeasurementDataNumeric(request, new Double(success)));        		        		
+        	} else if (metricName.equals(FAILED_MINUTE_METRIC_NAME)) {
+        		report.addData(new MeasurementDataNumeric(request, new Double(failed)));        		        		
+        	} else if (metricName.equals(OVERALL_BYTES_METRIC_NAME)) {
+        		report.addData(new MeasurementDataNumeric(request, new Double(counterBytesProcessed + counterBytesFailed)));
         	}
     	}
     }

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	2008-09-29 02:50:21 UTC (rev 23156)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	2008-09-29 03:05:43 UTC (rev 23157)
@@ -42,8 +42,9 @@
     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_METRIC = "overallBytes";
+    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_FAILED = "overall bytes failed";
@@ -60,7 +61,14 @@
     public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
     	Configuration pluginConfig = this.context.getPluginConfiguration();
     	pluginConfig.put(new PropertySimple("type", "service"));
+<<<<<<< .mine
+    	Integer overallMessages = new Integer(0);
+    	
+    	int bytesProcessed = 0;
+    	int bytesFailed = 0;
+=======
     	Integer overallMessages = null;
+>>>>>>> .r23154
         for (MeasurementScheduleRequest request : requests) {
         	String metricName = request.getName();
         	if (metricName.equals(OVERALL_MESSAGE_METRIC)) {
@@ -72,6 +80,7 @@
         		Integer processed = new Integer(0);
         		if (attribute != null) {
         			processed = (Integer) attribute.refresh();
+        			bytesProcessed = processed.intValue();
         		}
         		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
         	} else if (metricName.equals(OVERALL_BYTES_FAILED_METRIC)) {
@@ -79,15 +88,27 @@
         		Integer processed = new Integer(0);
         		if (attribute != null) {
         			processed = (Integer) attribute.refresh();
+        			bytesFailed = processed.intValue();
         		}
         		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));        		
         	}
         }
+<<<<<<< .mine
         for (MeasurementScheduleRequest request : requests) {
         	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)));
         	}
         }
+=======
+        for (MeasurementScheduleRequest request : requests) {
+        	String metricName = request.getName();
+        	if (metricName.equals(OVERALL_MINUTE_METRIC_NAME)) {
+        		report.addData(new MeasurementDataNumeric(request, new Double(overallMessages.doubleValue())));
+        	}
+        }
+>>>>>>> .r23154
     }
 }




More information about the jboss-svn-commits mailing list