tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@gmail.com>
Subject Re: patch: spend time in bussines method
Date Fri, 13 Jan 2012 02:21:13 GMT
First, thank you so much for the patch!

We actually added something very similar to that in 3.1.3.  Check out:

  https://issues.apache.org/jira/browse/OPENEJB-1275

Open to any changes to that that might make it a better fit for your needs.  We could also
use some help documenting it.


-David

On Jan 12, 2012, at 2:05 AM, m1k0 wrote:

> 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