webapps.mason: add broken builder display to dashboard

db4
Slava Pestov 2010-09-04 18:22:00 -07:00
parent 608a9261f1
commit 29fb8d39f9
3 changed files with 19 additions and 4 deletions

View File

@ -1,7 +1,7 @@
! 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 calendar db db.sqlite db.tuples db.types kernel USING: accessors calendar db db.sqlite db.tuples db.types kernel
math math.order sequences ; math math.order sequences combinators.short-circuit ;
IN: mason.server IN: mason.server
CONSTANT: +starting+ "starting" CONSTANT: +starting+ "starting"
@ -64,6 +64,13 @@ counter "COUNTER" {
builder new select-tuples builder new select-tuples
[ current-timestamp>> 5 hours ago before? ] filter ; [ current-timestamp>> 5 hours ago before? ] filter ;
: broken-builders ( -- seq )
builder new select-tuples
[
clean-timestamp>>
{ [ not ] [ 1 weeks ago before? ] } 1||
] filter ;
: mason-db ( -- db ) "resource:mason.db" <sqlite-db> ; : mason-db ( -- db ) "resource:mason.db" <sqlite-db> ;
: with-mason-db ( quot -- ) : with-mason-db ( quot -- )

View File

@ -9,8 +9,15 @@
</t:form> </t:form>
<h1>Crashed build machines</h1> <h1>Crashed build machines</h1>
<p>Crashed machines have not sent a heartbeat for several hours.</p>
<t:xml t:name="crashed" /> <t:xml t:name="crashed" />
<h1>Broken build machines</h1>
<p>Broken machines have not had a successful build for over a week.</p>
<t:xml t:name="broken" />
<h1>Make a release</h1> <h1>Make a release</h1>
<t:form t:action="$mason-app/dashboard/make-release"> <t:form t:action="$mason-app/dashboard/make-release">
<table> <table>

View File

@ -4,8 +4,8 @@ USING: accessors kernel mason.server furnace.actions
html.forms sequences xml.syntax webapps.mason.utils ; html.forms sequences xml.syntax webapps.mason.utils ;
IN: webapps.mason.downloads IN: webapps.mason.downloads
: crashed-builder-list ( -- xml ) : builder-list ( seq -- xml )
crashed-builders [ [
[ package-url ] [ [ os>> ] [ cpu>> ] bi "/" glue ] bi [ package-url ] [ [ os>> ] [ cpu>> ] bi "/" glue ] bi
[XML <li><a href=<->><-></a></li> XML] [XML <li><a href=<->><-></a></li> XML]
] map ] map
@ -15,6 +15,7 @@ IN: webapps.mason.downloads
<page-action> <page-action>
[ [
[ [
crashed-builder-list "crashed" set-value crashed-builders builder-list "crashed" set-value
broken-builders builder-list "broken" set-value
] with-mason-db ] with-mason-db
] >>init ; ] >>init ;