[Pkg-haskell-commits] darcs: tools: Show average build times
Joachim Breitner
mail at joachim-breitner.de
Thu Apr 25 08:31:25 UTC 2013
Thu Apr 25 08:28:49 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Show average build times
Ignore-this: a5fd4e84131f0f363bfac98b5d2f9ce6
M ./buildd-stats.py -3 +28
Thu Apr 25 08:28:49 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Show average build times
Ignore-this: a5fd4e84131f0f363bfac98b5d2f9ce6
diff -rN -u old-tools//buildd-stats.py new-tools//buildd-stats.py
--- old-tools//buildd-stats.py 2013-04-25 08:31:25.081521518 +0000
+++ new-tools//buildd-stats.py 2013-04-25 08:31:25.089521801 +0000
@@ -138,7 +138,9 @@
// More than one minute
format = 'm';
timespan = (period / 60).toFixed(2);
- }
+ } else {
+ timespan = period.toFixed(2);
+ }
/*
// Remove the s
@@ -305,12 +307,34 @@
var haskelluploads = sumup(d_haskell_pkgs);
$("#alluploads").text(alluploads);
$("#haskelluploads").text(haskelluploads);
- $("#uploadsperc").text((haskelluploads/alluploads * 100).toFixed() + "%");
+ if (alluploads> 0) {
+ $("#uploadsperc").text((haskelluploads/alluploads * 100).toFixed() + "%");
+ } else {
+ $("#uploadsperc").text("\u2014");
+ }
+
var allbuildtime = sumup(d_buildtime);
var haskellbuildtime = sumup(d_haskell_buildtime);
$("#allbuildtime").text(timespanFormatter(allbuildtime));
$("#haskellbuildtime").text(timespanFormatter(haskellbuildtime));
- $("#buildtimeperc").text((haskellbuildtime/allbuildtime * 100).toFixed() + "%");
+ if (allbuildtime > 0) {
+ $("#buildtimeperc").text((haskellbuildtime/allbuildtime * 100).toFixed() + "%");
+ } else {
+ $("#buildtimeperc").text("\u2014");
+ }
+
+ if (alluploads > 0) {
+ var allavgbuildtime = allbuildtime / alluploads
+ $("#allavgbuildtime").text(timespanFormatter(allavgbuildtime));
+ } else {
+ $("#allavgbuildtime").text("\u2014");
+ }
+ if (haskelluploads > 0) {
+ var haskellavgbuildtime = haskellbuildtime / haskelluploads
+ $("#haskellavgbuildtime").text(timespanFormatter(haskellavgbuildtime));
+ } else {
+ $("#haskellavgbuildtime").text("\u2014");
+ }
var wattage = 472; // http://www.vertatique.com/average-power-use-server
var kgco2perkwh = 0.5925; // http://www.carbonfund.org/how-we-calculate
@@ -401,6 +425,7 @@
<tbody>
<tr><th># uploads:</th><td id="alluploads"/><td id="haskelluploads"/><td id="uploadsperc"/></tr>
<tr><th>buildtime:</th><td id="allbuildtime"/><td id="haskellbuildtime"/><td id="buildtimeperc"/></tr>
+ <tr><th>avg. buildtime:</th><td id="allavgbuildtime"/><td id="haskellavgbuildtime"/><td> </td></tr>
<tr><th>CO<sub>2</sub>:<sup>*</sup></th><td id="allco2"/><td id="haskellco2"/><td> </td></tr>
</tbody>
</table>
More information about the Pkg-haskell-commits
mailing list