Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'think,': 0.05; 'bits': 0.07; 'decorator': 0.09; 'subject:log': 0.09; 'received:209.85.214.174': 0.13; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'this?': 0.19; 'cc:no real name:2**0': 0.21; 'wrote': 0.21; 'header:In-Reply-To:1': 0.22; 'modify': 0.25; 'cc:2**0': 0.26; 'code': 0.26; 'figure': 0.26; 'function': 0.27; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.29; 'url:library': 0.31; 'familiar': 0.32; 'requests': 0.32; 'it.': 0.33; 'hi,': 0.34; 'url:python': 0.35; 'received:209.85.214': 0.36; 'received:google.com': 0.37; 'using': 0.37; 'received:209.85': 0.38; 'url:org': 0.39; 'suggestions': 0.39; 'received:209': 0.39; 'your': 0.61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=cZsZrp2G0DKqjeuOKZ875JHlbrmsr1Llfkmr5K0eLhY=; b=AL15ObEHeGKCtkXNUarhdlDPO0ifWlNf03CoC21uq7nZy4JrDlrM82lU6qbwt7B08W 7jpJK5aTVG6Q0ihPKry2Zpqrl6qMG9/7QvAtycf1Z5BlbImmA2oXoZmMeNkNwwUsGauw aIfAv8oiHMvny2PEig9NniW9JPXhcM9mnoec4= MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 10 Feb 2012 12:38:34 +0000 Subject: Re: log and figure out what bits are slow and optimize them. From: Arnaud Delobelle To: sajuptpm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328877518 news.xs4all.nl 6913 [2001:888:2000:d::a6]:50127 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20160 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 . =C2=A0is 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 well. > > My requirement : log everything and figure out what bits are slow and > optimize them. > > What are your suggestions ?? Are you familiar with this? http://docs.python.org/library/profile.html --=20 Arnaud