[jboss-svn-commits] JBL Code SVN: r23655 - labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Oct 31 11:08:13 EDT 2008


Author: tcunning
Date: 2008-10-31 11:08:13 -0400 (Fri, 31 Oct 2008)
New Revision: 23655

Modified:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java
Log:
JBESB-2123
Implement overall message size at Service level.


Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java	2008-10-31 14:53:35 UTC (rev 23654)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java	2008-10-31 15:08:13 UTC (rev 23655)
@@ -36,7 +36,7 @@
 	private int m_procCount;
 	private String m_status;
 	private long m_procTime;
-	private int m_bytesProcessed;
+	private long m_bytesProcessed;
 	
 	
 	public static final String ACTION_SENT = "SENT";
@@ -55,13 +55,13 @@
 		m_bytesProcessed = 0;
 		try {
 			String bytes = (String) f_message.getProperties().getProperty(Environment.MESSAGE_BYTE_SIZE);
-			m_bytesProcessed = Integer.parseInt(bytes);
+			m_bytesProcessed = Long.parseLong(bytes);
 		} catch (NullPointerException npe) {			
 		} catch (NumberFormatException nfe) {
 		}
 	}
 	
-	public int getBytesProcessed() {
+	public long getBytesProcessed() {
 		return m_bytesProcessed;
 	}
 	

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java	2008-10-31 14:53:35 UTC (rev 23654)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java	2008-10-31 15:08:13 UTC (rev 23655)
@@ -67,6 +67,7 @@
 	private int serviceCount;
 	private long bytesFailed;
 	private long bytesProcessed;
+	private long bytesOverall;
 	
 	public static final String RESET_COUNTER = "resetCounter";
 	private static final String MESSAGE_COUNTER = "messages successfully processed count";
@@ -76,6 +77,7 @@
 	private static final String BYTES_PROCESSED = "processed bytes";
 	
 	private static final String OVERALL_SERVICE_COUNT = "overall service message count";
+	private static final String OVERALL_BYTES = "overall service count bytes";
 	private static final String OVERALL_BYTES_PROCESSED = "overall processedbytes";
 	private static final String OVERALL_BYTES_FAILED = "overall failed bytes";
 	
@@ -151,6 +153,7 @@
 		serviceCount = new Integer(0);
 		bytesProcessed = new Long(0);
 		bytesFailed = new Long(0);
+		bytesOverall = new Long(0);
 	}
 	
 	/**
@@ -161,6 +164,7 @@
 		serviceCount = 0 ;
 		bytesProcessed = 0 ;
 		bytesFailed = 0 ;
+		bytesOverall = 0;
 		
 		for (String key : actionCounterHash.keySet()) {
 			actionCounterHash.put(key, new IntHolder());
@@ -193,8 +197,8 @@
 		
 		int count = actionCounterHash.size() + actionProcessTimeHash.size()
 			+ actionFailedCounterHash.size() + actionBytesProcessedHash.size() 
-			+ actionBytesFailedHash.size() + 3; // the extra 3 here are overall service count, failed byte size
-												  // and processed byte size
+			+ actionBytesFailedHash.size() + 4; // the extra 4 here are overall service count, failed byte size
+												  // processed byte size, and overall bytes
         MBeanAttributeInfo[] attrs = new MBeanAttributeInfo[count];
         int counter = 0;
               
@@ -232,7 +236,7 @@
 				"Property " + OVERALL_SERVICE_COUNT, true, false, false);
 		attrs[counter] = overallCount;
 		counter++;
-
+		
 		MBeanAttributeInfo overallBytesProcessed = new MBeanAttributeInfo(OVERALL_BYTES_PROCESSED, "java.lang.Long",
 				"Property " + OVERALL_BYTES_PROCESSED, true, false, false);
 		attrs[counter] = overallBytesProcessed;
@@ -243,6 +247,11 @@
 		attrs[counter] = overallBytesFailed;
 		counter++;
 		
+		MBeanAttributeInfo overallBytes = new MBeanAttributeInfo(OVERALL_BYTES, "java.lang.Long", 
+				"Property " + OVERALL_BYTES, true, false, false);
+		attrs[counter] = overallBytes;
+		counter++;		
+		
         MBeanOperationInfo[] opers = {
         	new MBeanOperationInfo(
         			RESET_COUNTER, "Reset the counter",
@@ -283,6 +292,8 @@
     		return bytesProcessed;
     	} else if (OVERALL_BYTES_FAILED.equals(key)) {
     		return bytesFailed;
+    	} else if (OVERALL_BYTES.equals(key)) {
+    		return bytesOverall;
     	}
     	return null;
     }
@@ -431,6 +442,7 @@
 			bFailed.value += asb.getBytesProcessed();
 			bytesFailed += asb.getBytesProcessed();
 		}
+		bytesOverall += asb.getBytesProcessed();
 	}
 	
 	protected ObjectName getObjectName()




More information about the jboss-svn-commits mailing list