[jboss-cvs] JBossAS SVN: r69841 - trunk/ejb3/src/main/org/jboss/ejb3/statistics.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 14 12:37:53 EST 2008


Author: bdecoste
Date: 2008-02-14 12:37:53 -0500 (Thu, 14 Feb 2008)
New Revision: 69841

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/statistics/InvocationStatistics.java
Log:
[EJBTHREE-1176] view InvocationStatistics from jmx-console

Modified: trunk/ejb3/src/main/org/jboss/ejb3/statistics/InvocationStatistics.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/statistics/InvocationStatistics.java	2008-02-14 15:45:18 UTC (rev 69840)
+++ trunk/ejb3/src/main/org/jboss/ejb3/statistics/InvocationStatistics.java	2008-02-14 17:37:53 UTC (rev 69841)
@@ -139,6 +139,36 @@
     */
    public String toString()
    {
+      StringBuffer tmp = new StringBuffer("InvocationStatistics concurrentCalls='");
+      tmp.append(concurrentCalls);
+      tmp.append("' \n");
+
+      HashMap copy = new HashMap(methodStats);
+      Iterator iter = copy.entrySet().iterator();
+      while (iter.hasNext())
+      {
+         Map.Entry entry = (Map.Entry) iter.next();
+         TimeStatistic stat = (TimeStatistic) entry.getValue();
+         if (stat != null)
+         {
+            tmp.append("<method name='");
+            tmp.append(entry.getKey());
+            tmp.append("' count='");
+            tmp.append(stat.count);
+            tmp.append("' minTime='");
+            tmp.append(stat.minTime);
+            tmp.append("' maxTime='");
+            tmp.append(stat.maxTime);
+            tmp.append("' totalTime='");
+            tmp.append(stat.totalTime);
+            tmp.append("' \n");
+         }
+      }
+      return tmp.toString();
+   }
+   
+   public String toXmlString()
+   {
       StringBuffer tmp = new StringBuffer("<InvocationStatistics concurrentCalls='");
       tmp.append(concurrentCalls);
       tmp.append("' >\n");




More information about the jboss-cvs-commits mailing list