Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread sajuptpm
I decided to create a decorator like. import cProfile def debug_time(method): def timed(*args, **kw): prof = cProfile.Profile() prof.enable(subcalls=False, builtins=False) result = prof.runcall(method, *args, **kw) #prof.print_stats() msg = "\n\n\n\n###

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread John Gordon
In Kev Dwyer writes: > *Any* instrumentation code is going to affect performance. Funny story about that... I wanted to profile some code of mine, and a colleague recommended the 'hotshot' module. It's pretty easy to use: there are functions to start profiling, stop profiling and print resul

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread Kev Dwyer
sajuptpm wrote: > Hi, > > Yes i saw profile module, > I think i have to do function call via > > cProfile.run('foo()') > > I know, we can debug this way. > > But, i need a fixed logging system and want to use it in production. > I think, we can't permanently include profile's debugging c

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread Mark Lawrence
Please don't top post. On 10/02/2012 12:59, Saju M wrote: Yes i saw profile module, I think, i have to do function call via cProfile.run('foo()') I know, we can debug this way. But, I need a fixed logging system and want to use it in production. I think, we can't permanently include profi

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread sajuptpm
Hi, Yes i saw profile module, I think i have to do function call via cProfile.run('foo()') I know, we can debug this way. But, i need a fixed logging system and want to use it in production. I think, we can't permanently include profile's debugging code in source code, will cause any

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread Saju M
Yes i saw profile module, I think, i have to do function call via cProfile.run('foo()') I know, we can debug this way. But, I need a fixed logging system and want to use it in production. I think, we can't permanently include profile's debugging code in source code, will cause any perfor

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread Saju M
On Fri, Feb 10, 2012 at 6:12 PM, Saju M wrote: > Hi, > > Yes i saw profile module, > I think i have to do function call via > > cProfile.run('foo()') > > I know, we can debug this way. > > But i need a fixed logging system .. > > > > On Fri, Feb 10, 2012 at 6:08 PM, Arnaud Delobelle wrote: > >> O

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread Saju M
Hi, Yes i saw profile module, I think i have to do function call via cProfile.run('foo()') I know, we can debug this way. But i need a fixed logging system .. On Fri, Feb 10, 2012 at 6:08 PM, Arnaud Delobelle wrote: > On 10 February 2012 12:30, sajuptpm wrote: > > Hi, > > > > I want to lo

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread Arnaud Delobelle
On 10 February 2012 12:30, sajuptpm wrote: > Hi, > > I want to log time taken to complete database requests inside a method/ > function using decorator .  is it possible > I think, i have to inject log code inside the method/fuctions or > modify it. > I wrote a decorator to log taken by a met

log and figure out what bits are slow and optimize them.

2012-02-10 Thread sajuptpm
Hi, I want to log time taken to complete database requests inside a method/ function using decorator . is it possible I think, i have to inject log code inside the method/fuctions or modify it. I wrote a decorator to log taken by a method/function to complete it execution and its working wel