Mailinglist Archive: opensuse-buildservice (233 mails)

< Previous Next >
Re: [opensuse-buildservice] [Patch] Display average building time
  • From: "Jan-Simon Möller" <dl9pf@xxxxxx>
  • Date: Thu, 18 Dec 2008 11:25:08 +0100
  • Message-id: <200812181125.08647.dl9pf@xxxxxx>
Fixed version ...

Best,
Jan-Simon
Am Wednesday 17 December 2008 21:47:30 schrieb Jan-Simon Möller:
Hi !

The attached patches display the average time needed to build a package per
arch below the "Blocked Queue".
It uses exponential smoothing (smoothing factor 0.3) to calculate the average.

Have phun!
Jan-Simon




Index: bs_sched
===================================================================
--- bs_sched (Revision 5929)
+++ bs_sched (Arbeitskopie)
@@ -84,6 +84,9 @@

my %remoteprojs; # remote project cache

+my $buildavg = 0;
+
+
sub unify {
my %h = map {$_ => 1} @_;
return grep(delete($h{$_}), @_);
@@ -1732,6 +1735,11 @@
print " - $job is outdated\n";
return;
}
+ # calculate exponential weighted average
+ my $myjobtime = time() - $status->{'readytime'};
+ my $weight = 0.3;
+ $buildavg = ($weight * $myjobtime) + ((1 - $weight) * $buildavg);
+
delete $status->{'job'}; # no longer building

delete $status->{'arch'}; # obsolete
@@ -3946,5 +3954,6 @@
$worst->{'time'} = $prpchecktimes{$prp};
push @{$sinfo->{'worst'}}, $worst;
}
+ $sinfo->{'buildavg'} = $buildavg;
writexml("$infodir/.schedulerinfo.$myarch",
"$infodir/schedulerinfo.$myarch", $sinfo, $BSXML::schedulerinfo);
}
< Previous Next >
References