Mailinglist Archive: opensuse-buildservice (250 mails)

< Previous Next >
[opensuse-buildservice] [RFC][PATCH] make a table out of waiting/blocked/average time
  • From: "Jan-Simon Möller" <dl9pf@xxxxxx>
  • Date: Tue, 28 Apr 2009 16:22:36 +0200
  • Message-id: <200904281622.37522.dl9pf@xxxxxx>
Hi !

The attached patch is a first version to replace the text statistics for
waiting, blocked and the new average build time with a table for better
overview.

Kudos to darix for helping me with activexml 8-) .

Best regards,
Jan-Simon
Index: views/monitor/index.rhtml
===================================================================
--- views/monitor/index.rhtml (Revision 7209)
+++ views/monitor/index.rhtml (Arbeitskopie)
@@ -7,6 +7,6 @@
<%= render :partial => 'scheduler' %>
<%= render :partial => 'building' %>
<%= render :partial => 'idle' %>
-<%= render :partial => 'waiting' %>
-<%= render :partial => 'blocked' %>
+<!--<%= render :partial => 'waiting' %>
+<%= render :partial => 'blocked' %>-->
<%= render :partial => 'average' %>
Index: views/monitor/_average.rhtml
===================================================================
--- views/monitor/_average.rhtml (Revision 7209)
+++ views/monitor/_average.rhtml (Arbeitskopie)
@@ -1,5 +1,43 @@
-<br>
+<!--<br>
<h2>Average building time</h2>
<% @workerstatus.each_buildavg.sort {|a,b| a.arch <=> b.arch }.each do |entry|
%>
<%= entry.arch %>: <%=
distance_of_time_in_words(Time.at(entry.buildavg.to_i), Time.at(0), true) %>
<br />
<% end %>
+-->
+
+<table class="building">
+ <thead>
+ <tr>
+ <th>Host Arch</th>
+ <th>Packages in waiting queue</th>
+ <th>Packages in blocked queue</th>
+ <th><center>Average Job time</center></th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @workerstatus.each_waiting.sort {|a,b| a.arch <=> b.arch }.each do
|entrywaiting| %>
+ <% outblocked = " - " %>
+ <% outbuildavg = " - " %>
+ <tr>
+ <td class="arch">
+ <%= entrywaiting.arch %>
+ </td>
+ <td class="waiting">
+ <center><%= entrywaiting.jobs %></center>
+ </td>
+ <td class="blocked">
+ <% if
@workerstatus.blocked("@arch='#{entrywaiting.arch}'").has_attribute? :jobs -%>
+ <% outblocked =
@workerstatus.blocked("@arch='#{entrywaiting.arch}'").jobs %>
+ <% end %>
+ <center><%= outblocked %></center>
+ </td>
+ <td class="avgjobtime">
+ <% if
@workerstatus.buildavg("@arch='#{entrywaiting.arch}'").has_attribute? :buildavg
-%>
+ <% outbuildavg =
distance_of_time_in_words(Time.at(@workerstatus.buildavg("@arch='#{entrywaiting.arch}'").buildavg.to_i),
Time.at(0), true) %>
+ <% end %>
+ <center><%= outbuildavg %> </center>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
< Previous Next >
This Thread
  • No further messages