Merge lp:~rvb/launchpad/builders-timeout-bug-887078-eager-load into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Raphaël Badin | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 14329 | ||||
Proposed branch: | lp:~rvb/launchpad/builders-timeout-bug-887078-eager-load | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~rvb/launchpad/builders-timeout-bug-887078-use-getSpecificJobs | ||||
Diff against target: |
267 lines (+138/-29) 4 files modified
lib/lp/buildmaster/tests/test_buildfarmjob.py (+15/-5) lib/lp/code/model/sourcepackagerecipebuild.py (+28/-1) lib/lp/soyuz/browser/tests/test_builder_views.py (+59/-22) lib/lp/soyuz/model/binarypackagebuild.py (+36/-1) |
||||
To merge this branch: | bzr merge lp:~rvb/launchpad/builders-timeout-bug-887078-eager-load | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+82008@code.launchpad.net |
Commit message
Eager load data in getByBuildFarmJobs.
Description of the change
The ultimate goal is to make the number of queries issued by builder:+history independent of the number of builds. We have 3 types of builds displayed on these pages: BinaryPackageBuild, SourcePackageRe
This branch focuses on the elements of type BinaryPackageBuild and SourcePackageRe
- BinaryPackageBuild: the number of queries is now independent of the number of BinaryPackageBuilds \o/.
- SourcePackageRe
= Tests =
./bin/test -vvc test_builder_views test_build_
./bin/test -vvc test_builder_views test_build_
= Q/A =
None.
\o/
[1]
+ flush_database_ updates( ) ecorder( ) as recorder:
with StormStatementR
I end up doing this every time. I'll put a branch in ec2 that calls updates( ) in StormStatementR ecorder. __enter_ _().
flush_database_
[2]
+ build_farm_ jobs.extend( [build. build_farm_ job for build in builds2])
No need for the intermediate list, though I guess it does little harm.
[3]
+ # rvb 2011-11-11: Each build issues 2 new queries. cipe._recipe_ data cipeData. I've no idea how to prefetch
+ # This is because of the way SourcePackageRe
+ # fetches SourcePackageRe
+ # this.
I guess this is work in progress, but should probably be XXX'd
anyway. What do you think?