Merge lp:~lifeless/launchpad/lsprof into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Robert Collins on 2010-07-01 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11157 |
| Proposed branch: | lp:~lifeless/launchpad/lsprof |
| Merge into: | lp:launchpad |
| Prerequisite: | lp:~lifeless/launchpad/lognamer |
| Diff against target: |
301 lines (+122/-75) 6 files modified
lib/canonical/configure.zcml (+1/-0) lib/canonical/launchpad/doc/profiling.txt (+1/-1) lib/canonical/launchpad/webapp/publication.py (+7/-74) lib/lp/services/profile/__init__.py (+7/-0) lib/lp/services/profile/configure.zcml (+19/-0) lib/lp/services/profile/profile.py (+87/-0) |
| To merge this branch: | bzr merge lp:~lifeless/launchpad/lsprof |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | code | 2010-06-27 | Approve on 2010-07-01 |
|
Review via email:
|
|||
Description of the Change
Move our existing profiling code to be hook based, which makes it more orthogonal, easier to reason about.
| Robert Collins (lifeless) wrote : | # |
I'll move it to your preferred location.
What rules does testing load - the development set?
-Rob
| Curtis Hovey (sinzui) wrote : | # |
I am not sure I know what you mean by testing. Each environment has its own ZCML configuration (Which is also bad since there is a lot of duplication).
Everyone can see development and testrunner configs in the launchpad tree.
The production configs for staging, dogfood, edge, etc ..., are in
https:/
To enable profiling just on staging and dogfood requires an update to their respective directories in that branch.
| Robert Collins (lifeless) wrote : | # |
Yes, I can see that. I meant in the testrunner, because if its not
enabled in the test runner... it can't be tested :)
Anyhow, I think we may still want this on on production, so for now
I'm just going to leave it always configured - I do appreciate the
info though, particularly as I had a comment there.
I'll delete the comment to avoid confusion.
Rob
| Robert Collins (lifeless) wrote : | # |
Ok, I've moved the code as requested.
However, I don't know if it still meets the requirement of lp.services that
'packages in this namespace can only use general LAZR or library functionality.'
profile.py imports the canonical config, webapp adapter (for request
timing) and canonical.mem.
Do they need to be moved across first, before this is safe to port across?
-Rob
| Curtis Hovey (sinzui) wrote : | # |
Canonical.config and webapp adapter should move in our lifetime. They do not need to move now. There are many modules in lp.services using these.
I thought the import rules was removed because it was blocking refactoring. It certainly is being ignored. I think it is unrealistic. The attempt to make all webapp into lazr proved too daunting and I do not think there is any interest in it now. Just getting canonical.launchpad to die will raise a rally of cheers and beers.
| Robert Collins (lifeless) wrote : | # |
Ok, cool, I'll get both of these landed.

Thanks for extracting the profiling behaviour. I have a few remarks.
> === modified file 'lib/canonical/ launchpad/ webapp/ configure. zcml' launchpad/ webapp/ configure. zcml 2010-06-08 15:57:09 +0000 launchpad/ webapp/ configure. zcml 2010-06-27 09:23:29 +0000 zcml" />
> --- lib/canonical/
> +++ lib/canonical/
> @@ -13,6 +13,8 @@
> <include file="errorlog.
> -->
> <include file="bug-5133.zcml" />
> + <!-- Would be nice to turn this off in production -->
> + <include file="profile.zcml" />
Each env gets its own config. ./configs/ testrunner- appserver has ZCML development, and in ~launchpad- pqm/production- configs in
that registers YUI unittest hooks for example. I think this rule could
be in ./configs/
staging and dogfood.
> === added file 'lib/canonical/ launchpad/ webapp/ profile. py' launchpad/ webapp/ profile. py 1970-01-01 00:00:00 +0000 launchpad/ webapp/ profile. py 2010-06-27 09:23:29 +0000
> --- lib/canonical/
> +++ lib/canonical/
We do not want to add to this deprecated location. I think this would services/ profile
be better located at lib/lp/
> === added file 'lib/canonical/ launchpad/ webapp/ profile. zcml' launchpad/ webapp/ profile. zcml 1970-01-01 00:00:00 +0000 launchpad/ webapp/ profile. zcml 2010-06-27 09:23:29 +0000
> --- lib/canonical/
> +++ lib/canonical/
As above.