[llvm-commits] [zorg] r99781 - in /zorg/trunk/lnt/lnt: testing/__init__.py viewer/root.ptl viewer/simple.ptl
Daniel Dunbar
daniel at zuster.org
Sun Mar 28 15:08:44 PDT 2010
Author: ddunbar
Date: Sun Mar 28 17:08:44 2010
New Revision: 99781
URL: http://llvm.org/viewvc/llvm-project?rev=99781&view=rev
Log:
LNT: Tweak simple viewer to hide machine and run info by default, and to sort the table values.
Modified:
zorg/trunk/lnt/lnt/testing/__init__.py
zorg/trunk/lnt/lnt/viewer/root.ptl
zorg/trunk/lnt/lnt/viewer/simple.ptl
Modified: zorg/trunk/lnt/lnt/testing/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/testing/__init__.py?rev=99781&r1=99780&r2=99781&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/testing/__init__.py (original)
+++ zorg/trunk/lnt/lnt/testing/__init__.py Sun Mar 28 17:08:44 2010
@@ -14,7 +14,7 @@
if isinstance(t,float):
t = datetime.datetime.utcfromtimestamp(t)
elif not isinstance(t, datetime.datetime):
- t = time.strptime(start_time, '%Y-%m-%d %H:%M:%S')
+ t = datetime.datetime.strptime(t, '%Y-%m-%d %H:%M:%S')
return t.strftime('%Y-%m-%d %H:%M:%S')
class Report:
@@ -73,9 +73,9 @@
"""
def __init__(self, start_time, end_time, info={}):
if start_time is None:
- start_time = datetime.datetime.now()
+ start_time = datetime.datetime.utcnow()
if end_time is None:
- end_time = datetime.datetime.now()
+ end_time = datetime.datetime.utcnow()
self.start_time = normalize_time(start_time)
self.end_time = normalize_time(end_time)
Modified: zorg/trunk/lnt/lnt/viewer/root.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/root.ptl?rev=99781&r1=99780&r2=99781&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/root.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/root.ptl Sun Mar 28 17:08:44 2010
@@ -16,6 +16,7 @@
from quixote.directory import Directory, Resolving
from quixote.util import StaticDirectory
+import lnt
import PerfDB, Util
from PerfDB import Machine, Run
@@ -156,12 +157,14 @@
current = time.time()
"""
<hr>
+ LNT Version: %s<br>
Server Started: %s<br>
Generated: %s<br>
Render Time: %.2fs<br>
</body>
</html>
- """ % (time.strftime(str('%Y-%m-%dT%H:%M:%Sz'),
+ """ % (lnt.__version__,
+ time.strftime(str('%Y-%m-%dT%H:%M:%Sz'),
time.localtime(quixote.get_publisher().create_time)),
time.strftime(str('%Y-%m-%dT%H:%M:%Sz'),
time.localtime(current)),
Modified: zorg/trunk/lnt/lnt/viewer/simple.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/simple.ptl?rev=99781&r1=99780&r2=99781&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/simple.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/simple.ptl Sun Mar 28 17:08:44 2010
@@ -28,6 +28,21 @@
self.id = int(idstr)
except ValueError, exc:
raise TraversalError(str(exc))
+ self.popupDepth = 0
+
+ def renderPopupBegin [html] (self, id, title, hidden):
+ self.popupDepth += 1
+ """\
+ <p>
+ <a href="javascript://" onclick="toggleLayer('%s')"; id="%s_">(%s) %s</a>
+ <div id="%s" style="display: %s;" class="hideable_%d">
+ """ % (id, id, ("+","-")[hidden], title, id, ("","none")[hidden],
+ self.popupDepth)
+
+ def renderPopupEnd [html] (self):
+ """
+ </div>"""
+ self.popupDepth -= 1
def getInfo(self, db):
request = quixote.get_request()
@@ -117,11 +132,14 @@
<td> <b>Machine ID</b> </td>
<td> %d </td>
</tr>
- </table>
- <p>
- <table border=1>
- """ % (machine.name, machine.id)
- for mi in machine.info.values():
+ </table>""" % (machine.name, machine.id)
+
+ self.renderPopupBegin('machine_info', 'Machine Info', True)
+ """
+ <table border=1>"""
+ info = machine.info.values()
+ info.sort(key = lambda i: i.key)
+ for mi in info:
"""
<tr>
<td> <b>%s</b> </td>
@@ -129,11 +147,15 @@
</tr>
""" % (mi.key, mi.value)
"""
- </table>
- <p>
- <table border=1>
+ </table>"""
+ self.renderPopupEnd()
+
+ self.renderPopupBegin('run_info', 'Run Info', True)
"""
- for ri in run.info.values():
+ <table border=1>"""
+ info = run.info.values()
+ info.sort(key = lambda i: i.key)
+ for ri in info:
"""
<tr>
<td> <b>%s</b> </td>
@@ -141,8 +163,8 @@
</tr>
""" % (ri.key, ri.value)
"""
- </table>
- """
+ </table>"""
+ self.renderPopupEnd()
contents_fn(db, run, runs, compareTo)
@@ -316,7 +338,7 @@
for t in tests:
name = t.name.split(str('.'),1)[1]
test_names.add(name)
-
+
items = [(k,v.value) for k,v in t.info.items()]
items.sort()
key = tuple(items)
@@ -378,11 +400,11 @@
# FIXME: Check success
failed = not run_values
-
+
run_cell_value = "-"
if run_values:
- run_cell_value = "%.2f" % min(run_values)
-
+ run_cell_value = "%.3f" % min(run_values)
+
if failed:
"""
<td bgcolor="#FF0000">%s</td""" % run_cell_value
@@ -397,7 +419,7 @@
Util.PctCell(pct, delta=True).render()
else:
"""<td>-</td>"""
-
+
"""
<h3>Parameter Sets</h3>
More information about the llvm-commits
mailing list