You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Bilgin Ibryam <bi...@iguanait.com> on 2007/11/20 02:14:54 UTC

UtilTimer Question

Hi all, 

I wanted to see how long it takes the execution of some code snippets i
wrote and decided to use UtilTimer class for this purpose. It looks like
designed for this purpose (event not used at all in ofbiz applications).
So i did:

 UtilTimer utilTimer = new UtilTimer("my_name", true, true);
 utilTimer.timerString("My message", module);

I expected to see some logs in the console, but could not. 
After some digging the code i decided that Debug.log(Debug.TIMING,... is not
working as expected but not sure...

Any ideas what happens ? Do i have to configure some logger to see the
result ?
Any comments are welcome.

Bilgin Ibryam

PS: There is a typo in debug.properties file: print.verbose=ftrue   

-- 
View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13849073
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: UtilTimer Question

Posted by Bilgin Ibryam <bi...@iguanait.com>.
OK, i found the log message in debug.log file. I donot know why i missed it
before so many times.
Thanks for the help and sorry for loosing your time.

-- 
View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13892576
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: UtilTimer Question

Posted by Jacques Le Roux <ja...@les7arts.com>.
De : "Bilgin Ibryam" <bi...@iguanait.com>
> 
> Jacques, 
> 
> I try to use as much as possible existing ofbiz functionalities and
> UtilTimer seemed to me designed for this purpose. But now i could not find a
> way to use this class and i print manually, as you sugested.


I agree, I will try to have a look too next week, not winned...

Jacques

> -- 
> View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13877656
> Sent from the OFBiz - User mailing list archive at Nabble.com.
> 

Re: UtilTimer Question

Posted by Bilgin Ibryam <bi...@iguanait.com>.
Jacques, 

I try to use as much as possible existing ofbiz functionalities and
UtilTimer seemed to me designed for this purpose. But now i could not find a
way to use this class and i print manually, as you sugested.

-- 
View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13877656
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: UtilTimer Question

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Bilgin,

Quick answer, in the meantime (have no time to dig in) why not put begin and end marks and look their times in log ?

Jacques

> 
> Yes, i have.
> But if you look at CatalinaContainer.java:234 (your example) it does this
> way:
> Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
> 
> I wanted to print logs using UtilTimer class (because i want to track how
> long it takes the execution of my code snippets).
> 
> Here an example using UtilTimer: ServiceDispatcher:586
> 
>         if (Debug.timingOn()) {
>             UtilTimer.timerLog(localName + " / " + service.name, "ASync
> service started...", module);
>         }
> 
> Even Debug.timingOn() is true, i cannot see in trunk logs "ASync service
> started..."
> That is something buggy or a configuration issue for me.
> 
> Any ideas what for is this class and how can I use it ?
> -- 
> View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13873160
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: UtilTimer Question

Posted by Bilgin Ibryam <bi...@iguanait.com>.
Yes, i have.
But if you look at CatalinaContainer.java:234 (your example) it does this
way:
Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);

I wanted to print logs using UtilTimer class (because i want to track how
long it takes the execution of my code snippets).

Here an example using UtilTimer: ServiceDispatcher:586

        if (Debug.timingOn()) {
            UtilTimer.timerLog(localName + " / " + service.name, "ASync
service started...", module);
        }

Even Debug.timingOn() is true, i cannot see in trunk logs "ASync service
started..."
That is something buggy or a configuration issue for me.

Any ideas what for is this class and how can I use it ?
-- 
View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13873160
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: UtilTimer Question

Posted by Jacques Le Roux <ja...@les7arts.com>.
Don't you have information like this on the beginning of each console.log lines (or any log name you use for that) ?

2007-11-21 08:18:46,578 (main) [  CatalinaContainer.java:234:INFO ] Started Apache Tomcat/5.5.23

Jacques

De : "Bilgin Ibryam" <bi...@iguanait.com>
> 
> I tried with "print.timing=true" but still cannot print any logs using
> UtilTimer class.
> And this happens only in trunk version. I checked the console, log files,
> debug files... no result.
> I suppose it is a log4j configuration that i cannot figure out. 
> -- 
> View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13867778
> Sent from the OFBiz - User mailing list archive at Nabble.com.
> 

Re: UtilTimer Question

Posted by Bilgin Ibryam <bi...@iguanait.com>.
I tried with "print.timing=true" but still cannot print any logs using
UtilTimer class.
And this happens only in trunk version. I checked the console, log files,
debug files... no result.
I suppose it is a log4j configuration that i cannot figure out. 
-- 
View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13867778
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: UtilTimer Question

Posted by Jacques Le Roux <ja...@les7arts.com>.
Yes this is the easier way

Jacques

De : "Gautam Deb" <ga...@gmail.com>
> You need to turn on the OFBiz debug level "Timing" for printing of the
> desired message by setting the flag* print.timing=true *in *{ofbiz.home
> }/framework/base/config/debug.properties* file.
> 
> Regards,
> Gautam Deb
> 
> 
> On Nov 20, 2007 1:27 AM, Bilgin Ibryam <bi...@iguanait.com> wrote:
> >
> > Scott, Thank you for clarifying.
> >
> > I have to say that it is hard to distinguish one "=fture" value among 7
> > "=true" values in this file... I should read carefully these files.
> >
> > Regards
> > Bilgin
> >
> > --
> > View this message in context:
> http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13853344
> >
> > Sent from the OFBiz - User mailing list archive at Nabble.com.
> >
> >
> 

Re: UtilTimer Question

Posted by Gautam Deb <ga...@gmail.com>.
You need to turn on the OFBiz debug level "Timing" for printing of the
desired message by setting the flag* print.timing=true *in *{ofbiz.home
}/framework/base/config/debug.properties* file.

Regards,
Gautam Deb


On Nov 20, 2007 1:27 AM, Bilgin Ibryam <bi...@iguanait.com> wrote:
>
> Scott, Thank you for clarifying.
>
> I have to say that it is hard to distinguish one "=fture" value among 7
> "=true" values in this file... I should read carefully these files.
>
> Regards
> Bilgin
>
> --
> View this message in context:
http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13853344
>
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>

Re: UtilTimer Question

Posted by Bilgin Ibryam <bi...@iguanait.com>.
Scott, Thank you for clarifying.

I have to say that it is hard to distinguish one "=fture" value among 7
"=true" values in this file... I should read carefully these files.

Regards
Bilgin

-- 
View this message in context: http://www.nabble.com/UtilTimer-Question-tf4840589.html#a13853344
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: UtilTimer Question

Posted by Scott Gray <le...@gmail.com>.
Hi Bilgin

That's not a typo but simply a quick way of turning false into true (by
removing the f).

Regards
Scott

On 20/11/2007, Bilgin Ibryam <bi...@iguanait.com> wrote:
>
> PS: There is a typo in debug.properties file: print.verbose=ftrue
>
>