Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 582016 Details for
Bug 658940
app-portage/genlop: improve current merge time prediction
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v3: Fix use of uninitialized values
v3-0001-genlop-Calculate-more-accurate-merge-time.patch (text/plain), 2.38 KB, created by
Kai Krakow
on 2019-07-06 09:56:35 UTC
(
hide
)
Description:
v3: Fix use of uninitialized values
Filename:
MIME Type:
Creator:
Kai Krakow
Created:
2019-07-06 09:56:35 UTC
Size:
2.38 KB
patch
obsolete
>From 6129bc84b76e2f8f79e4c14e060757531be9fbbf Mon Sep 17 00:00:00 2001 >From: Kai Krakow <kai@kaishome.de> >Date: Sun, 24 Jun 2018 12:32:17 +0200 >Subject: [PATCH v3] genlop: Calculate more accurate merge time > >This patch adds a more precise current merge time prediction by using >two approaches: > > * only consider the last 10 merges to compensate for system changes > over time > > * remove the worst and best time to compensate for exceptional > merge times (overloading, binary merges) > >Signed-off-by: Kai Krakow <kai@kaishome.de> >--- > genlop | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > >diff --git a/genlop b/genlop >index b28c9d6..82b0eec 100755 >--- a/genlop >+++ b/genlop >@@ -28,6 +28,7 @@ use Term::ANSIColor; > use Date::Manip; > use LWP::Simple; > use File::Basename; >+use List::Util qw(min sum); > > my $version = "9999"; > my @logfiles = (); >@@ -704,6 +705,7 @@ sub current() > # 20050815 - JeR: On slow systems, running portageq takes a lot of time, > # sometimes enough to miss all the sandbox action completely. Better to > # not check for sanity and have users check their FEATURES instead. >+ my @merge_times = (); > my @targets = (); > my @sandbox_pids = (); > my @sandbox_procs = qx{ps ax -o pid,args | tail -n +2 | sed -e's/^ *//' | grep ' sandbox ' | grep -v ' grep '}; >@@ -757,6 +759,7 @@ sub current() > $e_count++; > >ime($e_end - $e_start); > $tm_secondi += ($e_end - $e_start); >+ unshift(@merge_times, ($e_end - $e_start)); > } > } > } >@@ -781,8 +784,24 @@ sub current() > > if ($e_count && $e_start) > { >- >ime(($tm_secondi / $e_count) - ($e_end - $e_start)); >- if (($e_end - $e_start) >= ($tm_secondi / $e_count)) >+ if ($e_count > 1) >+ { >+ # For a better prediction we only consider the last 10 merges >+ # to have a better bias to latest system changes. >+ my $num_elems = min(9, $#merge_times); >+ @merge_times = @merge_times[0..$num_elems]; >+ >+ # Now slice off the worst and best performing time to create >+ # a better prediction by removing exceptional performers. >+ @merge_times = sort(@merge_times); >+ @merge_times = @merge_times[1..8] if $#merge_times > 9; >+ >+ $e_count = 1; >+ $tm_secondi = sum(@merge_times) / $#merge_times; >+ } >+ >+ >ime($tm_secondi - ($e_end - $e_start)); >+ if (($e_end - $e_start) >= $tm_secondi) > { > print colored("any time now.\n", $COLORS{'green'}); > } >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 658940
:
537024
|
546668
| 582016