[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/spr-faster-time-estimation into lp:launchpad

2018-05-09 Thread noreply
The proposal to merge lp:~cjwatson/launchpad/spr-faster-time-estimation into 
lp:launchpad has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/spr-faster-time-estimation/+merge/345289
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/spr-faster-time-estimation into lp:launchpad

2018-05-09 Thread William Grant
Review: Approve code

Quite.
-- 
https://code.launchpad.net/~cjwatson/launchpad/spr-faster-time-estimation/+merge/345289
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/spr-faster-time-estimation into lp:launchpad

2018-05-09 Thread Colin Watson
Colin Watson has proposed merging 
lp:~cjwatson/launchpad/spr-faster-time-estimation into lp:launchpad.

Commit message:
Only consider the most recent nine successful builds when estimating recipe 
build durations.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1770121 in Launchpad itself: "manual build request timeouts for recipes 
with a gazillion builds"
  https://bugs.launchpad.net/launchpad/+bug/1770121

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/spr-faster-time-estimation/+merge/345289

Pulling every single completed build of the recipe back into Python is liable 
to time out.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad/spr-faster-time-estimation into lp:launchpad.
=== modified file 'lib/lp/code/model/sourcepackagerecipe.py'
--- lib/lp/code/model/sourcepackagerecipe.py	2018-03-02 01:11:48 +
+++ lib/lp/code/model/sourcepackagerecipe.py	2018-05-09 11:03:05 +
@@ -395,11 +395,13 @@
 """Return the median duration of builds of this recipe."""
 store = IStore(self)
 result = store.find(
-SourcePackageRecipeBuild,
+(SourcePackageRecipeBuild.date_started,
+ SourcePackageRecipeBuild.date_finished),
 SourcePackageRecipeBuild.recipe == self.id,
+SourcePackageRecipeBuild.status == BuildStatus.FULLYBUILT,
 SourcePackageRecipeBuild.date_finished != None)
-durations = [
-build.date_finished - build.date_started for build in result]
+result.order_by(Desc(SourcePackageRecipeBuild.date_finished))
+durations = [row[1] - row[0] for row in result[:9]]
 if len(durations) == 0:
 return None
 durations.sort(reverse=True)

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp