tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m1k0 <m1k0.regis...@gmail.com>
Subject patch: spend time in bussines method
Date Thu, 12 Jan 2012 10:05:27 GMT
Hi,
I propose some patch to ejb-core 3.1.2


# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to:
/home/m1k0/Projekty/opensource/repos/asf/openejb/tags/openejb-3.1.2/container/openejb-core/src/main/java/org/apache/openejb/core/ivm
# This patch can be applied using context Tools: Patch action on respective
folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: EjbObjectProxyHandler.java
--- EjbObjectProxyHandler.java Base (BASE)
+++ EjbObjectProxyHandler.java Locally Modified (Based On LOCAL)
@@ -58,9 +58,10 @@
     public Object _invoke(Object p, Class interfce, Method m, Object[] a)
throws Throwable {
         java.lang.Object retValue = null;
         java.lang.Throwable exc = null;
-
+        long startInMilis = 0;
         try {
             if (logger.isDebugEnabled()) {
+                startInMilis = System.currentTimeMillis();
                 logger.debug("invoking method " + m.getName() + " on " +
deploymentID + " with identity " + primaryKey);
             }
             Integer operation = (Integer) dispatchTable.get(m.getName());
@@ -145,10 +146,11 @@
             throw new RemoteException("Unknown Container Exception",
oe.getRootCause());
         } finally {
             if (logger.isDebugEnabled()) {
+                long duration = System.currentTimeMillis() - startInMilis;
                 if (exc == null) {
-                    logger.debug("finished invoking method " + m.getName()
+ ". Return value:" + retValue);
+                    logger.debug("finished invoking method " + m.getName()
+ "[Spent time: "+duration+"ms]. Return value:" + retValue);
                 } else {
-                    logger.debug("finished invoking method " + m.getName()
+ " with exception " + exc);
+                    logger.debug("finished invoking method " + m.getName()
+ "[Spent time: "+duration+"ms] with exception " + exc);
                 }
             }
         }


--
View this message in context: http://openejb.979440.n4.nabble.com/patch-spend-time-in-bussines-method-tp4288464p4288464.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message