summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornomennescio <nomennescio@factorcode.org>2024-05-02 22:42:22 +0100
committerJohn Benediktsson <mrjbq7@gmail.com>2024-05-02 15:20:44 -0700
commit0d73d7e9104e3b42dedc50787ddfb2eb7ca1f09d (patch)
tree67c53ce87be6cbb815ec558ecae66df292961a3c
parent9da080348de38bc8492940ae54a17a1d6188f688 (diff)
Remove filtering on timestamps and use short ISO8601 to display themHEADmastermainclean-windows-x86-32clean-macosx-x86-64clean-linux-x86-32
-rw-r--r--extra/webapps/mason/benchmarks/benchmarks.factor14
-rw-r--r--extra/webapps/mason/utils/utils.factor14
2 files changed, 16 insertions, 12 deletions
diff --git a/extra/webapps/mason/benchmarks/benchmarks.factor b/extra/webapps/mason/benchmarks/benchmarks.factor
index 67ed9b47b6..01b497b744 100644
--- a/extra/webapps/mason/benchmarks/benchmarks.factor
+++ b/extra/webapps/mason/benchmarks/benchmarks.factor
@@ -1,19 +1,19 @@
! Copyright (C) 2024 nomennescio.
! See https://factorcode.org/license.txt for BSD license.
-USING: accessors assocs combinators db.tuples formatting
-furnace.actions html.forms http.server.responses io
-io.streams.string kernel math.parser sequences
-webapps.mason.backend webapps.mason.utils ;
+USING: accessors assocs calendar calendar.format combinators
+db.tuples formatting furnace.actions html.forms
+http.server.responses io io.streams.string kernel math.parser
+sequences webapps.mason.backend webapps.mason.utils ;
IN: webapps.mason.benchmarks
: benchmark-results ( -- response )
[
[ selected-benchmarks ] with-mason-db
- "run,timestamp,host,os,cpu,git,name,duration (ns)" print
+ "run,timestamp (UTC),host,os,cpu,git,name,duration (ns)" print
'[
[ run-id>> ] [ name>> ] [ duration>> ] tri
- [ _ at { [ run-id>> ] [ timestamp>> ] [ host-name>> ] [ os>> ] [ cpu>> ] [ git-id>> ] } cleave ] 2dip
- "%s,\"%s\",%s,%s,%s,%s,%s,%s\n" printf
+ [ _ at { [ run-id>> ] [ timestamp>> timestamp>iso8601Z ] [ host-name>> ] [ os>> ] [ cpu>> ] [ git-id>> ] } cleave ] 2dip
+ "%s,%s,%s,%s,%s,%s,%s,%s\n" printf
] each
] with-string-writer
<text-content> ;
diff --git a/extra/webapps/mason/utils/utils.factor b/extra/webapps/mason/utils/utils.factor
index dcff45cb91..5598a0ab9c 100644
--- a/extra/webapps/mason/utils/utils.factor
+++ b/extra/webapps/mason/utils/utils.factor
@@ -1,14 +1,18 @@
! Copyright (C) 2010 Slava Pestov.
! See https://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs db.tuples furnace.actions
-furnace.utilities html.forms kernel mason.config math.parser
-namespaces sequences urls validators webapps.mason.backend
+USING: accessors arrays assocs calendar calendar.format
+db.tuples furnace.actions furnace.utilities html.forms
+io.streams.string kernel mason.config math.parser namespaces
+sequences urls validators webapps.mason.backend
webapps.mason.version.data xml.syntax ;
IN: webapps.mason.utils
: link ( url label -- xml )
[XML <a href=<->><-></a> XML] ;
+: timestamp>iso8601Z ( timestamp -- string )
+ [ >utc { YYYY MM DD "T" hhmm ss "Z" } formatted ] with-string-writer ;
+
: validate-os/cpu ( -- )
{
{ "os" [ v-one-line ] }
@@ -22,14 +26,14 @@ IN: webapps.mason.utils
{ "cpu" [ [ v-one-line ] v-optional ] }
{ "git" [ [ v-one-line ] v-optional ] }
{ "run" [ [ v-one-line ] v-optional ] }
- { "timestamp" [ [ v-one-line ] v-optional ] }
+ ! { "timestamp" [ [ v-one-line ] v-optional ] } ! parsing of ISO8601 is currently not supported
{ "name" [ [ v-one-line ] v-optional ] }
} validate-params ;
: selected-runs ( -- runs )
run new
"run" value dec> >>run-id
- "timestamp" value >>timestamp
+ ! "timestamp" value >>timestamp ! parsing of ISO8601 is currently not supported
"host" value >>host-name
"os" value >>os
"cpu" value >>cpu