[arvados] updated: 2.7.0-5998-ge1b8ff8941

git repository hosting git at public.arvados.org
Fri Feb 9 23:24:03 UTC 2024


Summary of changes:
 tools/crunchstat-summary/crunchstat_summary/summarizer.py | 12 +++++++++++-
 tools/crunchstat-summary/crunchstat_summary/webchart.py   | 15 ++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)

       via  e1b8ff8941da1b8f1eda141d8ec41f03fa9f9cfc (commit)
      from  c0d0d539515c7402dbb18e55052dd761066b08fd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e1b8ff8941da1b8f1eda141d8ec41f03fa9f9cfc
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Feb 9 18:23:36 2024 -0500

    19744: Include text report in HTML report
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index 2bd329719b..7957360617 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -632,7 +632,17 @@ class MultiSummarizer(object):
         return d
 
     def html_report(self):
-        return WEBCHART_CLASS(self.label, iter(self._descendants().values())).html()
+        txt = self.text_report()
+        fmt = """
+        <table>
+        <tbody>
+        {}
+        </tbody>
+        </table>
+        <p>{}</p>
+        """.format("\n".join("<tr><td>{}</td></tr>".format(x.replace("\t", "</td><td>")) for x in txt.split("\n") if not x.startswith("#")),
+                   "\n".join("{}<br>".format(x) for x in txt.split("\n") if x.startswith("#")))
+        return WEBCHART_CLASS(self.label, iter(self._descendants().values())).html(fmt)
 
 
 class JobTreeSummarizer(MultiSummarizer):
diff --git a/tools/crunchstat-summary/crunchstat_summary/webchart.py b/tools/crunchstat-summary/crunchstat_summary/webchart.py
index 31afcf64e9..8adf0fee7e 100644
--- a/tools/crunchstat-summary/crunchstat_summary/webchart.py
+++ b/tools/crunchstat-summary/crunchstat_summary/webchart.py
@@ -24,15 +24,24 @@ class WebChart(object):
         self.label = label
         self.summarizers = summarizers
 
-    def html(self):
+    def html(self, bodytext=''):
         return '''<!doctype html><html><head>
         <title>{} stats</title>
         <script type="text/javascript" src="{}"></script>
         <script type="text/javascript">{}</script>
+        <style>
+        table {{
+          width: 80%
+        }}
+        td {{
+          width: 20%;
+        }}
+        </style>
         {}
-        </head><body></body></html>
+        </head><body>{}</body></html>
         '''.format(escape(self.label),
-                   self.JSLIB, self.js(), self.headHTML())
+                   self.JSLIB, self.js(), self.headHTML(),
+                   bodytext)
 
     def js(self):
         return 'var chartdata = {};\n{}'.format(

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list