Mailinglist Archive: opensuse-buildservice (239 mails)

< Previous Next >
[opensuse-buildservice] [RFC/patch] obs/webclient: make table out of waiting/blocked/average statistics
  • From: "Jan-Simon Möller" <dl9pf@xxxxxx>
  • Date: Fri, 29 May 2009 16:45:11 +0200
  • Message-id: <200905291645.12151.dl9pf@xxxxxx>
Hi !

Please review this patch for the webclient - if there're no objections I'd like
to commit it to svn.

The patch creates a table out of the statistics on the bottom of the monitor
page.

Old: http://img5.imageshack.us/img5/7285/monitorold.png
New: http://img528.imageshack.us/img528/5344/monitornew.png

Best,
Jan-Simon
Index: app/views/monitor/_stats.rhtml
===================================================================
--- app/views/monitor/_stats.rhtml (Revision 0)
+++ app/views/monitor/_stats.rhtml (Revision 0)
@@ -0,0 +1,40 @@
+<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 !@xxxxxxxxxxxxxxxxxxxx("@arch='#{entrywaiting.arch}'").nil? -%>
+ <% if
@workerstatus.blocked("@arch='#{entrywaiting.arch}'").has_attribute? :jobs -%>
+ <% outblocked =
@workerstatus.blocked("@arch='#{entrywaiting.arch}'").jobs %>
+ <% end %>
+ <% end %>
+ <center><%= outblocked %></center>
+ </td>
+ <td class="avgjobtime">
+ <% if !@xxxxxxxxxxxxxxxxxxxxx("@arch='#{entrywaiting.arch}'").nil?
-%>
+ <% 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 %>
+ <% end %>
+ <center><%= outbuildavg %> </center>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
Index: app/views/monitor/index.rhtml
===================================================================
--- app/views/monitor/index.rhtml (Revision 7459)
+++ app/views/monitor/index.rhtml (Arbeitskopie)
@@ -7,6 +7,8 @@
<%= render :partial => 'scheduler' %>
<%= render :partial => 'building' %>
<%= render :partial => 'idle' %>
-<%= render :partial => 'waiting' %>
-<%= render :partial => 'blocked' %>
-<%= render :partial => 'average' %>
+<!-- <%= render :partial => 'waiting' %> -->
+<!-- <%= render :partial => 'blocked' %> -->
+<!-- <%= render :partial => 'average' %> -->
+<%= render :partial => 'stats' %>
+
< Previous Next >
Follow Ups