webapps.mason: show all the configured build machines, not just the failing ones.

db4
John Benediktsson 2012-08-13 16:21:32 -07:00
parent 7b2b3f5e9f
commit dda43cc647
3 changed files with 35 additions and 18 deletions

View File

@ -64,10 +64,19 @@ counter "COUNTER" {
: increment-counter-value ( -- n ) : increment-counter-value ( -- n )
counter-tuple [ 0 or 1 + dup ] change-value update-tuple ; counter-tuple [ 0 or 1 + dup ] change-value update-tuple ;
: all-builders ( -- builders )
builder new select-tuples ; inline
: crashed? ( builder -- ? )
heartbeat-timestamp>> 30 minutes ago before? ;
: broken? ( builder -- ? )
[ clean-git-id>> ] [ last-git-id>> ] bi = not ;
: funny-builders ( -- crashed broken ) : funny-builders ( -- crashed broken )
builder new select-tuples all-builders
[ [ heartbeat-timestamp>> 30 minutes ago before? ] filter ] [ [ crashed? ] filter ]
[ [ [ clean-git-id>> ] [ last-git-id>> ] bi = not ] filter ] [ [ broken? ] filter ]
bi ; bi ;
: os/cpu ( builder -- string ) : os/cpu ( builder -- string )

View File

@ -3,13 +3,8 @@
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0"> <t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<t:title>Mason dashboard</t:title> <t:title>Mason dashboard</t:title>
<h1>Crashed build machines</h1> <h1>Build machines</h1>
<p>Machines which are not sending heartbeats:</p> <t:xml t:name="builders" />
<t:xml t:name="crashed" />
<h1>Broken build machines</h1>
<p>Machines with failing builds:</p>
<t:xml t:name="broken" />
<h1>Force build now</h1> <h1>Force build now</h1>
<p>Requires build engineer status.</p> <p>Requires build engineer status.</p>

View File

@ -1,13 +1,28 @@
! Copyright (C) 2010 Slava Pestov. ! Copyright (C) 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel furnace.actions html.forms sequences USING: accessors combinators kernel furnace.actions html.forms
xml.syntax webapps.mason.backend webapps.mason.utils ; sequences sorting xml.syntax webapps.mason.backend
webapps.mason.utils ;
IN: webapps.mason.downloads IN: webapps.mason.downloads
CONSTANT: CRASHED
[XML <span style="background-color: yellow;">CRASHED</span> XML]
CONSTANT: BROKEN
[XML <span style="background-color: red; color: white;">BROKEN</span> XML]
: builder-status ( builder -- status/f )
{
{ [ dup crashed? ] [ drop CRASHED ] }
{ [ dup broken? ] [ drop BROKEN ] }
[ drop f ]
} cond ;
: builder-list ( seq -- xml ) : builder-list ( seq -- xml )
[ os/cpu ] sort-with
[ [
[ report-url ] [ os/cpu ] bi [ report-url ] [ os/cpu ] [ builder-status ] tri
[XML <li><a href=<->><-></a></li> XML] [XML <li><a href=<->><-></a> <-></li> XML]
] map ] map
[ [XML <p>No machines.</p> XML] ] [ [XML <p>No machines.</p> XML] ]
[ [XML <ul><-></ul> XML] ] [ [XML <ul><-></ul> XML] ]
@ -17,9 +32,7 @@ IN: webapps.mason.downloads
<page-action> <page-action>
[ [
[ [
funny-builders all-builders builder-list
[ builder-list ] bi@ "builders" set-value
[ "crashed" set-value ]
[ "broken" set-value ] bi*
] with-mason-db ] with-mason-db
] >>init ; ] >>init ;