support a profile decorator for use in staging and development environments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Gary Poster |
Bug Description
08:11 < lifeless> you know the ++oops++ magic decorator thingy
08:11 < lifeless> ^ technical term
08:11 < sinzui> I do
08:11 < lifeless> what might be really nice
08:11 < lifeless> is a magical ++profile++ decorator enabled only on staging (and for non-devs it turns itself off once the user is determined)
08:12 < mars> ooo
08:12 < lifeless> it could write the profile to a directory that gets rsynced to devpad
08:12 < mars> +1
08:12 < lifeless> and put the filename in the timing block at the end of the page
08:12 < lifeless> so you could just do this
08:12 < lifeless> wait a couple of mintes
08:12 < lifeless> and have a kcachegrind ready analysis
08:13 -!- brianchidester [~brianchid@
08:13 < sinzui> thanks
08:13 < lifeless> (I can show you the exact functions in bzrlib to call to use its lsprof glue; though we may want a tweaked version or a lock around the profiling to kick other threads off, or something)
08:14 < lifeless> mars: launchpad-
08:14 < mars> lifeless, yep!
08:14 < lifeless> I shall file a bug
The way I think this would work is as follows:
I would type in https:/
the decorator would kick in and:
take a 'I'm profiling, yo' lock;
take a 'no other requests permitted lock' (maybe the same one)
wait for all other requests to finish (to avoid reporting their work)
assign an id for the profile in a similar way to oops assignment
continue with the request
the request would include the profile id in its comment block at the bottom
request completes and unwinds
profile is collated into a kcachegrind file - see the bzrlib.lsprof module for all of the profiling stuff here - do not roll your own; its annoying to get right
locks are released
cron job/inotify whatever copies the kcachegrind files on staging to devpad
developers can look locally if they are doing this with dev.launchpad.net
profit!
Related branches
- Robert Collins (community): Approve
-
Diff: 367 lines (+148/-81)9 files modified.bzrignore (+1/-0)
lib/canonical/configure.zcml (+1/-0)
lib/canonical/launchpad/doc/profiling.txt (+1/-7)
lib/canonical/launchpad/webapp/interfaces.py (+27/-0)
lib/canonical/launchpad/webapp/publication.py (+5/-74)
lib/lp/scripts/utilities/importfascist.py (+1/-0)
lib/lp/services/profile/__init__.py (+7/-0)
lib/lp/services/profile/configure.zcml (+19/-0)
lib/lp/services/profile/profile.py (+86/-0)
- Robert Collins (community): Approve
-
Diff: 1324 lines (+840/-215)11 files modified.bzrignore (+1/-0)
configs/development/apidoc-configure-normal.zcml (+6/-0)
configs/development/launchpad-lazr.conf (+3/-0)
lib/canonical/config/schema-lazr.conf (+8/-2)
lib/canonical/launchpad/doc/profiling.txt (+109/-175)
lib/canonical/launchpad/icing/style-3-0.css.in (+28/-1)
lib/canonical/launchpad/webapp/errorlog.py (+16/-12)
lib/lp/services/profile/configure.zcml (+7/-2)
lib/lp/services/profile/profile.pt (+77/-0)
lib/lp/services/profile/profile.py (+131/-23)
lib/lp/services/profile/tests.py (+454/-0)
Changed in launchpad-foundations: | |
assignee: | nobody → Māris Fogels (mars) |
Changed in launchpad-foundations: | |
assignee: | Māris Fogels (mars) → Gary Poster (gary) |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
+1, I want to schedule this.