Merge lp://staging/~gary/launchpad/bug838878 into lp://staging/launchpad
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13858 |
Proposed branch: | lp://staging/~gary/launchpad/bug838878 |
Merge into: | lp://staging/launchpad |
Prerequisite: | lp://staging/~gary/launchpad/bug838869 |
Diff against target: |
913 lines (+430/-117) 3 files modified
lib/lp/services/profile/profile.pt (+121/-36) lib/lp/services/profile/profile.py (+153/-53) lib/lp/services/profile/tests.py (+156/-28) |
To merge this branch: | bzr merge lp://staging/~gary/launchpad/bug838878 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
j.c.sackett (community) | Approve | ||
Review via email:
|
Commit message
[r=jcsackett][bug=838878] ++profile++ has a new conditional sqltrace feature and a new sql option.
Description of the change
This branch lets ++profile++ expose the new conditional sqltrace functionality enabled by changes in lp:~gary/launchpad/bug838869 .
This branch is just over the limit, for which I apologize.
The new features for ++profile++ are as follows:
- ++profile++sqltrace adds a mini-language for specifying what SQL requests you want to trace. ++profile++sqltrace continues to get tracebacks for all SQL. "++profile+
- ++profile++sql is now available, only giving SQL without any profiling or stacktrace information.
The changes for ++profile++ are as follows:
You combine requests in ++profile++ with "&" now, not ",", so "++profile+
Lint is happy except for its usual confusion with the beginning of the template.
Trying this out on a dev machine should be as easy as going to https:/
QA should be similar: https:/
Gary--
This looks good. I see one possible problem in the updated profile template, pointed out below.
> === modified file 'lib/lp/ services/ profile/ profile. pt' services/ profile/ profile. pt 2011-08-22 17:08:02 +0000 services/ profile/ profile. pt 2011-09-01 17:17:32 +0000 +profile+ +show</ code>.< /tal:block> <tal:block condition="not: ++profile+ +show</ code>), a KCacheGrind- friendly log on the ++profile+ +show</ code>), a KCacheGrind- friendly log on the ++profile+ +callgrind< /code>) , a PStats-friendly log ++profile+ +pstats< /code>) , or an HTML view of the SQL and the ++profile+ +pstats< /code>) , an HTML view of the SQL and the ++profile+ +sqltrace< /code>) . You can also combine these ++profile+ +show,callgrind </code> or +profile+ +show,pstats< /code> or others, .</tal: block>< /p> ++profile+ +sqltrace< /code>) , or an HTML view of only the SQL ++profile+ +sql</code> ). You can also combine these ++profile+ +show&callgrind </code> or +profile+ +show&pstats< /code> or others, with each action separated .</tal: block>< /p>
> --- lib/lp/
> +++ lib/lp/
> @@ -64,15 +64,21 @@
> get immediate profiling results in the browser, use
> <code>+
> always_log">In order to get profiling results, you need to ask for an HTML
> - view (<code>
> + view of the profile and OOPS data including SQL calls
> + (<code>
> filesystem (<code>
> (Python standard library) on the filesystem
> - (<code>
> + (<code>
> Python stacktrace when each SQL call was made
> - (<code>
> - (<code>
> - <code>+
> - with each action separated with commas)
> + (<code>
> + (<code>
> + (<code>
> + <code>+
> + with commas)
I may be misunderstanding this, but shouldn't this be "separated with ambersands" as shown in the example?
> === modified file 'lib/lp/ services/ profile/ profile. py' ).lower( ) for item in actions.split(',')) ).lower( ).partition( ':')
> @@ -505,24 +521,108 @@
> # include traversal in the profile.
> actions, slash, tail = end.partition('/')
> result.update(
> - action for action in (
> - item.strip(
> - if action)
> + (name.strip(), config.strip())
> + for name, partition, config in (
> + item.strip(
> + for item in actions.split('&'))
> + if name.strip())
There's no problem in the above bit, just thought that was one hell of a generator expression. :-P