Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 658940 | Differences between
and this patch

Collapse All | Expand All

(-)a/genlop (-3 / +21 lines)
Lines 28-33 use Term::ANSIColor; Link Here
28
use Date::Manip;
28
use Date::Manip;
29
use LWP::Simple;
29
use LWP::Simple;
30
use File::Basename;
30
use File::Basename;
31
use List::Util qw(min sum);
31
32
32
my $version  = "9999";
33
my $version  = "9999";
33
my @logfiles = ();
34
my @logfiles = ();
Lines 704-709 sub current() Link Here
704
	# 20050815 - JeR: On slow systems, running portageq takes a lot of time,
705
	# 20050815 - JeR: On slow systems, running portageq takes a lot of time,
705
	# sometimes enough to miss all the sandbox action completely. Better to
706
	# sometimes enough to miss all the sandbox action completely. Better to
706
	# not check for sanity and have users check their FEATURES instead.
707
	# not check for sanity and have users check their FEATURES instead.
708
	my @merge_times  = ();
707
	my @targets      = ();
709
	my @targets      = ();
708
	my @sandbox_pids = ();
710
	my @sandbox_pids = ();
709
	my @sandbox_procs = qx{ps ax -o pid,args | tail -n +2 | sed -e's/^ *//' | grep ' sandbox ' | grep -v ' grep '};
711
	my @sandbox_procs = qx{ps ax -o pid,args | tail -n +2 | sed -e's/^ *//' | grep ' sandbox ' | grep -v ' grep '};
Lines 757-762 sub current() Link Here
757
					$e_count++;
759
					$e_count++;
758
					&gtime($e_end - $e_start);
760
					&gtime($e_end - $e_start);
759
					$tm_secondi += ($e_end - $e_start);
761
					$tm_secondi += ($e_end - $e_start);
762
					unshift(@merge_times, ($e_end - $e_start));
760
				}
763
				}
761
			}
764
			}
762
		}
765
		}
Lines 781-788 sub current() Link Here
781
784
782
		if ($e_count && $e_start)
785
		if ($e_count && $e_start)
783
		{
786
		{
784
			&gtime(($tm_secondi / $e_count) - ($e_end - $e_start));
787
			if ($e_count > 1)
785
			if (($e_end - $e_start) >= ($tm_secondi / $e_count))
788
			{
789
				# For a better prediction we only consider the last 10 merges
790
				# to have a better bias to latest system changes.
791
				my $num_elems = min(9, $#merge_times);
792
				@merge_times = @merge_times[0..$num_elems];
793
794
				# Now slice off the worst and best performing time to create
795
				# a better prediction by removing exceptional performers.
796
				@merge_times = sort(@merge_times);
797
				@merge_times = @merge_times[1..8] if $#merge_times > 9;
798
799
				$e_count = 1;
800
				$tm_secondi = sum(@merge_times) / $#merge_times;
801
			}
802
803
			&gtime($tm_secondi - ($e_end - $e_start));
804
			if (($e_end - $e_start) >= $tm_secondi)
786
			{
805
			{
787
				print colored("any time now.\n", $COLORS{'green'});
806
				print colored("any time now.\n", $COLORS{'green'});
788
			}
807
			}
789
- 

Return to bug 658940