kpi: Add links to latest test run info.

For easier click-through to see recent results.
This commit is contained in:
Ben Greear
2020-05-01 08:51:30 -07:00
parent 11e8362be9
commit 5dec4bebd9
2 changed files with 33 additions and 6 deletions

View File

@@ -154,6 +154,9 @@ public class kpi {
runs.sort(new SortbyDate());
// Link to latest test run that has the test id
Hashtable<String, Run> test_id_links = new Hashtable();
// We have read everything into memory.
// For each test, generate data over time.
Hashtable<String, History> hist_data = new Hashtable();
@@ -164,6 +167,7 @@ public class kpi {
Run run = runs.elementAt(i);
Test t = run.findTest(tname);
if (t != null) {
test_id_links.put(tname, run);
try {
History hist = hist_data.get(tname);
if (hist == null) {
@@ -252,7 +256,13 @@ public class kpi {
String npngt = hk + "::" + ck + "-thumb.png";
png.renameTo(new File(dir + File.separator + npngt));
plots.append("<tr><td>" + hk + "</td><td>" + title + "</td><td><a href=\"" + npng + "\"><img src=\"" + npngt + "\"></a></td></tr>\n");
String hk_str = hk;
Run last = test_id_links.get(hk);
if (last != null) {
hk_str = "<a href=\"" + last.getName() + "/" + hk + "/index.html\">" + hk + "</a>";
}
plots.append("<tr><td>" + hk_str + "</td><td>" + title + "</td><td><a href=\"" + npng + "\"><img src=\"" + npngt + "\"></a></td></tr>\n");
}
catch (Exception ee) {
@@ -342,7 +352,13 @@ public class kpi {
String npngt = hk + "::" + g + "-thumb.png";
png.renameTo(new File(dir + File.separator + npngt));
groups.append("<tr><td>" + hk + "</td><td>" + title + "</td><td><a href=\"" + npng + "\"><img src=\"" + npngt + "\"></a></td></tr>\n");
String hk_str = hk;
Run last = test_id_links.get(hk);
if (last != null) {
hk_str = "<a href=\"" + last.getName() + "/" + hk + "/index.html\">" + hk + "</a>";
}
groups.append("<tr><td>" + hk_str + "</td><td>" + title + "</td><td><a href=\"" + npng + "\"><img src=\"" + npngt + "\"></a></td></tr>\n");
}
catch (Exception ee) {
@@ -353,14 +369,17 @@ public class kpi {
}
String test_bed = "Test Bed";
String last_run = "";
boolean cp = true;
for (int i = 0; i<runs.size(); i++) {
Run run = runs.elementAt(i);
test_bed = run.getTestRig();
runs_rows.append("<tr><td>" + i + "</td><td><a href=\"" + run.getName() + "/index.html\">" + run.getName() + "</a></td><td>" + run.getDate()
+ "</td><td>" + run.getDutHwVer() + "</td><td>" + run.getDutSwVer()
+ "</td><td>" + run.getDutModelNum() + "</td></tr>\n");
String row_text = ("<tr><td>" + i + "</td><td><a href=\"" + run.getName() + "/index.html\">" + run.getName() + "</a></td><td>" + run.getDate()
+ "</td><td>" + run.getDutHwVer() + "</td><td>" + run.getDutSwVer()
+ "</td><td>" + run.getDutModelNum() + "</td></tr>\n");
last_run = row_text;
runs_rows.append(row_text);
if (cp) {
try {
@@ -390,6 +409,7 @@ public class kpi {
line = line.replace("___GROUP_GRAPHS___", groups.toString());
line = line.replace("___DATA_GRAPHS___", plots.toString());
line = line.replace("___TEST_RUNS___", runs_rows.toString());
line = line.replace("___LATEST_RUN___", last_run);
bw.write(line);
}

View File

@@ -23,6 +23,13 @@
<div class='contentDiv'>
<br>
<h3>Latest test run details.</h3>
<table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px">
<tr><th>Test ID</th><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</th></tr>
___LATEST_RUN___
</table>
<P>
<h3>Historical graphs for each Data Set Group.</h3>
<table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px">
@@ -31,7 +38,7 @@
</table>
<P>
<h3>Individual Test Run Details.</h3>
<h3>All Individual Test Run Details.</h3>
<table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px">
<tr><th>Test ID</th><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</th></tr>
___TEST_RUNS___