aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorADAM GARZA <thefewproduction@gmail.com>2018-07-31 11:21:39 -0500
committerYang Song <songy23@users.noreply.github.com>2018-07-31 09:21:39 -0700
commit631e8e8430f30220d4be7b24422d57ba978b5675 (patch)
tree7d1c49698124ccebcca2ff7eab28d9ce1d16653f /contrib
parentefc4f90499a481fc3b612810c7231246b6b44d9a (diff)
downloadopencensus-java-631e8e8430f30220d4be7b24422d57ba978b5675.tar.gz
Top-level style class added for Zpages use + Final commit for GSoC... (#1351)
Diffstat (limited to 'contrib')
-rw-r--r--contrib/zpages/build.gradle3
-rw-r--r--contrib/zpages/src/main/java/io/opencensus/contrib/zpages/RpczZPageHandler.java87
-rw-r--r--contrib/zpages/src/main/java/io/opencensus/contrib/zpages/StatszZPageHandler.java156
-rw-r--r--contrib/zpages/src/main/java/io/opencensus/contrib/zpages/Style.java73
-rw-r--r--contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TraceConfigzZPageHandler.java36
-rw-r--r--contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TracezZPageHandler.java65
-rw-r--r--contrib/zpages/src/resources/style.css102
7 files changed, 195 insertions, 327 deletions
diff --git a/contrib/zpages/build.gradle b/contrib/zpages/build.gradle
index e9e5d089..9648d64e 100644
--- a/contrib/zpages/build.gradle
+++ b/contrib/zpages/build.gradle
@@ -14,6 +14,3 @@ dependencies {
signature "org.codehaus.mojo.signature:java18:+@signature"
}
-
-sourceSets.main.resources.srcDirs = [ "src/resources/" ]
-sourceSets.main.resources.includes = [ "**/*.css" ]
diff --git a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/RpczZPageHandler.java b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/RpczZPageHandler.java
index 85207c8d..4d79fb0c 100644
--- a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/RpczZPageHandler.java
+++ b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/RpczZPageHandler.java
@@ -113,9 +113,6 @@ final class RpczZPageHandler extends ZPageHandler {
private static final String RPCZ_URL = "/rpcz";
private static final String SENT = "Sent";
private static final String RECEIVED = "Received";
- private static final String TITLE_COLOR = "\"#FFF\"";
- private static final String TABLE_HEADER_COLOR = "\"#A94442\"";
- private static final String TABLE_ROW_COLOR = "\"#FFF\"";
private static final double SECONDS_PER_MINUTE = 60.0;
private static final double SECONDS_PER_HOUR = 3600.0;
private static final double NANOS_PER_SECOND = 1e9;
@@ -226,27 +223,7 @@ final class RpczZPageHandler extends ZPageHandler {
private static void emitStyle(PrintWriter out) {
out.write("<style>\n");
- out.write(
- "body{font-family:'Roboto',sans-serif;font-size:14px;" + "background-color:#F2F4EC;}\n");
- out.write("h1{color:#3D3D3D;text-align:center; margin-bottom:20px;}\n");
- out.write("p{padding:0 0.5em;color:#3D3D3D}\n");
- out.write(
- "table{width:100%;color:#FFF;overflow:hidden;" + "margin-bottom:30px;margin-top:0;}\n");
- out.write("tr:nth-child(even){background-color:#F2F2F2;}\n");
- out.write("tr.border-bottom td{border-bottom:1px solid #3D3D3D}\n");
- out.write("td.border-right,th.border-right{border-right:1px solid #3D3D3D;}\n");
- out.write("td.border-left{border-left:1px solid #3D3D3D}\n");
- out.write("td{color:#3D3D3D;line-height:2.0;}\n");
- out.write("p.title{margin-bottom:0;}\n");
- out.write(
- "p.header {font-family:'Open Sans',sans-serif;top:0;left:0;width:100%;"
- + "height:60px;vertical-align:middle;color:#C1272D;font-size:22pt;}\n");
- out.write(".header span{color:#3D3D3D;}\n");
- out.write("img.oc {vertical-align:middle;}\n");
- out.write(
- "th.l1{border-left:1px solid #FFF;border-bottom:1px solid #FFF;" + "margin:0 10px;}\n");
- out.write("td.l2{border-left:1px solid #3D3D3D;text-align:center;}\n");
- out.write("th.border-bottom,td.border-bottom{border-bottom:1px solid #FFF;}\n");
+ out.write(Style.style);
out.write("</style>\n");
}
@@ -258,7 +235,7 @@ final class RpczZPageHandler extends ZPageHandler {
out.write("<html lang=\"en\"><head>\n");
out.write("<meta charset=\"utf-8\">\n");
out.write("<title>RpcZ</title>\n");
- out.write("<link rel=\"shortcut icon\" href=\"//www.opencensus.io/favicon.ico\"/>\n");
+ out.write("<link rel=\"shortcut icon\" href=\"https://opencensus.io/images/favicon.ico\"/>\n");
out.write(
"<link href=\"https://fonts.googleapis.com/css?family=Open+Sans:300\""
+ "rel=\"stylesheet\">\n");
@@ -291,10 +268,10 @@ final class RpczZPageHandler extends ZPageHandler {
private void emitSummaryTable(PrintWriter out, Formatter formatter, boolean isReceived) {
formatter.format(
- "<p class=\"title\"><table bgcolor=%s width=100%%><tr align=left><td><font size=+2>"
- + "%s</font></td></tr></table></p>",
- TITLE_COLOR, (isReceived ? RECEIVED : SENT));
- formatter.format("<table bgcolor=%s frame=box cellspacing=0 cellpadding=2>", TABLE_ROW_COLOR);
+ "<h2><table class=\"title\"><tr align=left><td><font size=+2>"
+ + "%s</font></td></tr></table></h2>",
+ (isReceived ? RECEIVED : SENT));
+ formatter.format("<table frame=box cellspacing=0 cellpadding=2>");
emitSummaryTableHeader(out, formatter);
Map<String, StatsSnapshot> snapshots = getStatsSnapshots(isReceived);
for (Entry<String, StatsSnapshot> entry : snapshots.entrySet()) {
@@ -306,21 +283,21 @@ final class RpczZPageHandler extends ZPageHandler {
private static void emitSummaryTableHeader(PrintWriter out, Formatter formatter) {
// First line.
- formatter.format("<tr bgcolor=%s>", TABLE_HEADER_COLOR);
+ formatter.format("<tr bgcolor=#A94442>");
out.write("<th></th><td></td>");
for (String rpcStatsType : RPC_STATS_TYPES) {
- formatter.format("<th class=\"l1\" colspan=3>%s</th>", rpcStatsType);
+ formatter.format("<th class=\"borderLB\" colspan=3>%s</th>", rpcStatsType);
}
out.write("</tr>");
// Second line.
- formatter.format("<tr bgcolor=%s>", TABLE_HEADER_COLOR);
- out.write("<th class=\"border-bottom\" bgcolor=#A94442 align=left>Method</th>\n");
- out.write("<td class=\"border-bottom\" bgcolor=#A94442>&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ formatter.format("<tr bgcolor=#A94442>");
+ out.write("<th align=left>Method</th>\n");
+ out.write("<td bgcolor=#A94442>&nbsp;&nbsp;&nbsp;&nbsp;</td>");
for (int i = 0; i < RPC_STATS_TYPES.size(); i++) {
- out.write("<th class=\"l1\" bgcolor=#A94442 align=center>Min.</th>\n");
- out.write("<th class=\"l1\" bgcolor=#A94442 align=center>Hr.</th>\n");
- out.write("<th class=\"l1\" bgcolor=#A94442 align=center>Tot.</th>");
+ out.write("<th class=\"borderLB\" align=center>Min.</th>\n");
+ out.write("<th class=\"borderLB\" align=center>Hr.</th>\n");
+ out.write("<th class=\"borderLB\" align=center>Tot.</th>");
}
}
@@ -329,24 +306,24 @@ final class RpczZPageHandler extends ZPageHandler {
out.write("<tr>");
formatter.format("<td><b>%s</b></td>", method);
out.write("<td></td>");
- formatter.format("<td class=\"l2\">%d</td>", snapshot.countLastMinute);
- formatter.format("<td class=\"l2\">%d</td>", snapshot.countLastHour);
- formatter.format("<td class=\"l2\">%d</td>", snapshot.countTotal);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.avgLatencyLastMinute);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.avgLatencyLastHour);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.avgLatencyTotal);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.rpcRateLastMinute);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.rpcRateLastHour);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.rpcRateTotal);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.inputRateLastMinute);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.inputRateLastHour);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.inputRateTotal);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.outputRateLastMinute);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.outputRateLastHour);
- formatter.format("<td class=\"l2\">%.3f</td>", snapshot.outputRateTotal);
- formatter.format("<td class=\"l2\">%d</td>", snapshot.errorsLastMinute);
- formatter.format("<td class=\"l2\">%d</td>", snapshot.errorsLastHour);
- formatter.format("<td class=\"l2\">%d</td>", snapshot.errorsTotal);
+ formatter.format("<td class=\"borderLC\">%d</td>", snapshot.countLastMinute);
+ formatter.format("<td class=\"borderLC\">%d</td>", snapshot.countLastHour);
+ formatter.format("<td class=\"borderLC\">%d</td>", snapshot.countTotal);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.avgLatencyLastMinute);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.avgLatencyLastHour);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.avgLatencyTotal);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.rpcRateLastMinute);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.rpcRateLastHour);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.rpcRateTotal);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.inputRateLastMinute);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.inputRateLastHour);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.inputRateTotal);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.outputRateLastMinute);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.outputRateLastHour);
+ formatter.format("<td class=\"borderLC\">%.3f</td>", snapshot.outputRateTotal);
+ formatter.format("<td class=\"borderLC\">%d</td>", snapshot.errorsLastMinute);
+ formatter.format("<td class=\"borderLC\">%d</td>", snapshot.errorsLastHour);
+ formatter.format("<td class=\"borderLC\">%d</td>", snapshot.errorsTotal);
out.write("</tr>");
}
diff --git a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/StatszZPageHandler.java b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/StatszZPageHandler.java
index 8e7d682b..00c72d6c 100644
--- a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/StatszZPageHandler.java
+++ b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/StatszZPageHandler.java
@@ -89,10 +89,6 @@ final class StatszZPageHandler extends ZPageHandler {
@VisibleForTesting static final String QUERY_PATH = "path";
private static final String STATSZ_URL = "/statsz";
- private static final String TITLE_COLOR = "#FFF";
- private static final String TABLE_BACKGROUND_COLOR = "#FFF";
- private static final String TABLE_HEADER_COLOR = "#A94442";
- private static final String ALIGN_LEFT = "align=\"left\"";
private static final String CLASS_LARGER_TR = "directory-tr";
private static final String TABLE_HEADER_VIEW = "View Name";
private static final String TABLE_HEADER_DESCRIPTION = "Description";
@@ -129,7 +125,12 @@ final class StatszZPageHandler extends ZPageHandler {
out.write("<html lang=\"en\"><head>\n");
out.write("<meta charset=\"utf-8\">\n");
out.write("<title>StatsZ</title>\n");
- out.write("<link rel=\"shortcut icon\" href=\"//www.opencensus.io/favicon.ico\"/>\n");
+ out.write("<link rel=\"shortcut icon\" href=\"https://opencensus.io/images/favicon.ico\"/>\n");
+ out.write(
+ "<link href=\"https://fonts.googleapis.com/css?family=Open+Sans:300\""
+ + "rel=\"stylesheet\">\n");
+ out.write(
+ "<link href=\"https://fonts.googleapis.com/css?family=Roboto\"" + "rel=\"stylesheet\">\n");
Formatter formatter = new Formatter(out, Locale.US);
emitStyles(out, formatter);
out.write("</head>\n");
@@ -146,30 +147,7 @@ final class StatszZPageHandler extends ZPageHandler {
private static void emitStyles(PrintWriter out, Formatter formatter) {
out.write("<style>");
- out.write(
- "body{font-family:'Roboto',sans-serif;font-size:14px;" + "background-color:#F2F4EC;}\n");
- out.write("h1{color:#3D3D3D;text-align:center; margin-bottom:20px;}\n");
- out.write("p.view{font-size:20px;margin-bottom:0;}\n");
- out.write("h2{line-height:2.0;padding:0 0.5em;}\n");
- out.write("h3{font-size:16px;padding:0 0.5em;margin-top:4px;margin-bottom:25px;}\n");
- out.write("p{padding:0 0.5em;color:#3D3D3D}\n");
- out.write("p.header{font-family:'Open Sans',sans-serif;top:0;left:0;width:100%;\n");
- out.write("height:60px;vertical-align:middle;color:#C1272D;font-size:22pt;}\n");
- out.write(".header span{color:#3D3D3D;}\n");
- out.write("img.oc{vertical-align:middle;}\n");
- out.write("table{color:#FFF;width:100%;margin-bottom:30px;}\n");
- out.write("tr.border-bottom td{border-bottom:1px solid #3D3D3D}\n");
- out.write("table.borders{border-left:1px solid #3D3D3D;border-right:1px solid #3D3D3D;}\n");
- out.write("th{line-height:3.0;padding:0 0.5em;text-align:left;}\n");
- out.write("tr:nth-child(even) {background-color:#F2F2F2;}\n");
- out.write("td.border-left{border-left:1px solid #3D3D3D;}\n");
- out.write("tr.smaller{font-size:16px;padding:0 0.5em;background-color:#F2F4EC;}\n");
- out.write("td{color:#3D3D3D;line-height:2.0;padding:0 0.5em;text-align:left;}\n");
- out.write("th.l1{border-left:1px solid #FFF}\n");
- out.write("a{color:#A94442;}\n");
- formatter.format("h2{background-color: %s;}", TITLE_COLOR);
- formatter.format("table{background-color: %s;}", TABLE_BACKGROUND_COLOR);
- formatter.format("thead{background-color: %s;}", TABLE_HEADER_COLOR);
+ out.write(Style.style);
formatter.format(".%s{font-size:150%%}", CLASS_LARGER_TR);
out.write("</style>");
}
@@ -252,13 +230,13 @@ final class StatszZPageHandler extends ZPageHandler {
path = "";
}
emitDirectoryHeader(path, out, formatter);
- out.write("<table cellspacing=0 cellpadding=0>");
+ out.write("<table class=\"title\" cellspacing=0 cellpadding=0>");
for (Entry<String, TreeNode> entry : currentNode.children.entrySet()) {
TreeNode child = entry.getValue();
String relativePath = entry.getKey();
if (child.viewName == null) { // Directory node, emit a row for directory.
formatter.format(
- "<tr class=\"smaller\"><td>Directory: <a href='?%s=%s'>%s</a> (%d %s)</td></tr>",
+ "<tr class=\"direct\"><td>Directory: <a href='?%s=%s'>%s</a> (%d %s)</td></tr>",
QUERY_PATH,
path + '/' + relativePath,
relativePath,
@@ -267,7 +245,7 @@ final class StatszZPageHandler extends ZPageHandler {
} else { // View node, emit a row for view.
String viewName = child.viewName.asString();
formatter.format(
- "<tr class=\"smaller\"><td>View: <a href='?%s=%s'>%s</a></td></tr>",
+ "<tr class=\"direct\"><td>View: <a href='?%s=%s'>%s</a></td></tr>",
QUERY_PATH, path + '/' + relativePath, viewName);
}
}
@@ -316,15 +294,14 @@ final class StatszZPageHandler extends ZPageHandler {
private static void emitViewData(
/*@Nullable*/ ViewData viewData, View.Name viewName, PrintWriter out, Formatter formatter) {
if (viewData == null) {
- formatter.format(
- "<p class=\"%s\">No Stats found for View %s.</p>", CLASS_LARGER_TR, viewName.asString());
+ formatter.format("<p class=\"view\">No Stats found for View %s.</p>", viewName.asString());
return;
}
View view = viewData.getView();
emitViewInfo(view, viewData.getWindowData(), out, formatter);
- formatter.format("<p class=\"view\">Stats for View %s</p>", view.getName().asString());
+ formatter.format("<p class=\"view\">Stats for View: %s</p>", view.getName().asString());
- formatter.format("<table class=\"borders\" cellspacing=0 cellpadding=0>");
+ formatter.format("<table cellspacing=0 cellpadding=0>");
emitViewDataTableHeader(view, out, formatter);
for (Entry<List</*@Nullable*/ TagValue>, AggregationData> entry :
viewData.getAggregationMap().entrySet()) {
@@ -336,14 +313,14 @@ final class StatszZPageHandler extends ZPageHandler {
private static void emitViewInfo(
View view, ViewData.AggregationWindowData windowData, PrintWriter out, Formatter formatter) {
- formatter.format("<table width=100%% class=\"borders\" cellspacing=0 cellpadding=0>");
+ formatter.format("<table width=100%% cellspacing=0 cellpadding=0>");
emitViewInfoHeader(out, formatter);
out.write("<tbody>");
- out.write("<tr class=\"border-bottom\">"); // One row that represents the selected view.
+ out.write("<tr>"); // One row that represents the selected view.
formatter.format("<td>%s</td>", view.getName().asString());
- formatter.format("<td class=\"border-left\">%s</td>", view.getDescription());
- formatter.format("<td class=\"border-left\">%s</td>", view.getMeasure().getName());
+ formatter.format("<td class=\"borderLL\">%s</td>", view.getDescription());
+ formatter.format("<td class=\"borderLL\">%s</td>", view.getMeasure().getName());
String aggregationType =
view.getAggregation()
.match(
@@ -365,13 +342,13 @@ final class StatszZPageHandler extends ZPageHandler {
throw new AssertionError();
}
});
- formatter.format("<td class=\"border-left\">%s</td>", aggregationType);
+ formatter.format("<td class=\"borderLL\">%s</td>", aggregationType);
windowData.match(
new Function<ViewData.AggregationWindowData.CumulativeData, Void>() {
@Override
public Void apply(ViewData.AggregationWindowData.CumulativeData arg) {
- formatter.format("<td class=\"border-left\">%s</td>", toDate(arg.getStart()));
- formatter.format("<td class=\"border-left\">%s</td>", toDate(arg.getEnd()));
+ formatter.format("<td class=\"borderLL\">%s</td>", toDate(arg.getStart()));
+ formatter.format("<td class=\"borderLL\">%s</td>", toDate(arg.getEnd()));
return null;
}
},
@@ -394,11 +371,11 @@ final class StatszZPageHandler extends ZPageHandler {
out.write("<thead>");
out.write("<tr>");
formatter.format("<th colspan=1 align=left>%s</th>", TABLE_HEADER_VIEW);
- formatter.format("<th colspan=1 class=\"l1\" align=left>%s</th>", TABLE_HEADER_DESCRIPTION);
- formatter.format("<th colspan=1 class=\"l1\" align=left>%s</th>", TABLE_HEADER_MEASURE);
- formatter.format("<th colspan=1 class=\"l1\" align=left>%s</th>", TABLE_HEADER_AGGREGATION);
- formatter.format("<th colspan=1 class=\"l1\" align=left>%s</th>", TABLE_HEADER_START);
- formatter.format("<th colspan=1 class=\"l1\" align=left>%s</th>", TABLE_HEADER_END);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_DESCRIPTION);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_MEASURE);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_AGGREGATION);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_START);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_END);
out.write("</tr>");
out.write("</thead>");
}
@@ -407,7 +384,7 @@ final class StatszZPageHandler extends ZPageHandler {
out.write("<thead>");
out.write("<tr>");
for (TagKey tagKey : view.getColumns()) {
- formatter.format("<th align=left>TagKey: %s (string)</th>", tagKey.getName());
+ formatter.format("<th class=\"borderRL\">TagKey: %s (string)</th>", tagKey.getName());
}
String unit = view.getMeasure().getUnit();
view.getAggregation()
@@ -415,27 +392,26 @@ final class StatszZPageHandler extends ZPageHandler {
new Function<Sum, Void>() {
@Override
public Void apply(Sum arg) {
- formatter.format("<th class=\"l1\" align=left>%s, %s</th>", TABLE_HEADER_SUM, unit);
+ formatter.format("<th class=\"borderL\">%s, %s</th>", TABLE_HEADER_SUM, unit);
return null;
}
},
new Function<Count, Void>() {
@Override
public Void apply(Count arg) {
- formatter.format("<th class=\"l1\" align=left>%s</th>", TABLE_HEADER_COUNT);
+ formatter.format("<th class=\"borderL\">%s</th>", TABLE_HEADER_COUNT);
return null;
}
},
new Function<Distribution, Void>() {
@Override
public Void apply(Distribution arg) {
- formatter.format(
- "<th class=\"l1\" align=left>%s, %s</th>", TABLE_HEADER_MEAN, unit);
- formatter.format("<th class=\"l1\" align=left>%s</th>", TABLE_HEADER_COUNT);
- formatter.format("<th class=\"l1\" align=left>%s, %s</th>", TABLE_HEADER_MAX, unit);
- formatter.format("<th class=\"l1\" align=left>%s, %s</th>", TABLE_HEADER_MIN, unit);
- formatter.format("<th class=\"l1\" align=left>%s</th>", TABLE_HEADER_DEV);
- formatter.format("<th class=\"l1\" align=left>%s</th>", TABLE_HEADER_HISTOGRAM);
+ formatter.format("<th>%s, %s</th>", TABLE_HEADER_MEAN, unit);
+ formatter.format("<th class=\"borderL\">%s</th>", TABLE_HEADER_COUNT);
+ formatter.format("<th class=\"borderL\">%s, %s</th>", TABLE_HEADER_MAX, unit);
+ formatter.format("<th class=\"borderL\">%s, %s</th>", TABLE_HEADER_MIN, unit);
+ formatter.format("<th class=\"borderL\">%s</th>", TABLE_HEADER_DEV);
+ formatter.format("<th class=\"borderL\">%s</th>", TABLE_HEADER_HISTOGRAM);
return null;
}
},
@@ -443,7 +419,7 @@ final class StatszZPageHandler extends ZPageHandler {
@Override
public Void apply(LastValue arg) {
formatter.format(
- "<th class=\"l1\" align=left>%s, %s</th>", TABLE_HEADER_LAST_VALUE, unit);
+ "<th class=\"borderL\">%s, %s</th>", TABLE_HEADER_LAST_VALUE, unit);
return null;
}
},
@@ -456,9 +432,8 @@ final class StatszZPageHandler extends ZPageHandler {
// some
// deprecated RPC views.
if (arg instanceof Aggregation.Mean) {
- formatter.format(
- "<th class=\"l1\" align=left>%s, %s</th>", TABLE_HEADER_MEAN, unit);
- formatter.format("<th class=\"l1\" align=left>%s</th>", TABLE_HEADER_COUNT);
+ formatter.format("<th>%s, %s</th>", TABLE_HEADER_MEAN, unit);
+ formatter.format("<th class=\"borderL\">%s</th>", TABLE_HEADER_COUNT);
return null;
}
throw new IllegalArgumentException("Unknown Aggregation.");
@@ -473,10 +448,10 @@ final class StatszZPageHandler extends ZPageHandler {
Entry<List</*@Nullable*/ TagValue>, AggregationData> entry,
PrintWriter out,
Formatter formatter) {
- out.write("<tr class=\"border-bottom\">");
+ out.write("<tr>");
for (/*@Nullable*/ TagValue tagValue : entry.getKey()) {
String tagValueStr = tagValue == null ? "" : tagValue.asString();
- formatter.format("<td class=\"border-left\" %s>%s</td>", ALIGN_LEFT, tagValueStr);
+ formatter.format("<td class=\"borderRL\">%s</td>", tagValueStr);
}
entry
.getValue()
@@ -484,23 +459,21 @@ final class StatszZPageHandler extends ZPageHandler {
new Function<SumDataDouble, Void>() {
@Override
public Void apply(SumDataDouble arg) {
- formatter.format(
- "<td class=\"border-left\" %s>%.3f</td>", ALIGN_LEFT, arg.getSum());
+ formatter.format("<td class=\"borderLL\">%.3f</td>", arg.getSum());
return null;
}
},
new Function<SumDataLong, Void>() {
@Override
public Void apply(SumDataLong arg) {
- formatter.format("<td class=\"border-left\" %s>%d</td>", ALIGN_LEFT, arg.getSum());
+ formatter.format("<td class=\"borderLL\">%d</td>", arg.getSum());
return null;
}
},
new Function<CountData, Void>() {
@Override
public Void apply(CountData arg) {
- formatter.format(
- "<td class=\"border-left\" %s>%d</td>", ALIGN_LEFT, arg.getCount());
+ formatter.format("<td class=\"borderLL\">%d</td>", arg.getCount());
return null;
}
},
@@ -509,17 +482,12 @@ final class StatszZPageHandler extends ZPageHandler {
public Void apply(DistributionData arg) {
checkArgument(
view.getAggregation() instanceof Distribution, "Distribution expected.");
+ formatter.format("<td>%.3f</td>", arg.getMean());
+ formatter.format("<td class=\"borderLL\">%d</td>", arg.getCount());
+ formatter.format("<td class=\"borderLL\">%.3f</td>", arg.getMax());
+ formatter.format("<td class=\"borderLL\">%.3f</td>", arg.getMin());
formatter.format(
- "<td class=\"border-left\" %s>%.3f</td>", ALIGN_LEFT, arg.getMean());
- formatter.format(
- "<td class=\"border-left\" %s>%d</td>", ALIGN_LEFT, arg.getCount());
- formatter.format(
- "<td class=\"border-left\" %s>%.3f</td>", ALIGN_LEFT, arg.getMax());
- formatter.format(
- "<td class=\"border-left\" %s>%.3f</td>", ALIGN_LEFT, arg.getMin());
- formatter.format(
- "<td class=\"border-left\" %s>%.3f</td>",
- ALIGN_LEFT, arg.getSumOfSquaredDeviations());
+ "<td class=\"borderLL\">%.3f</td>", arg.getSumOfSquaredDeviations());
emitHistogramBuckets(
((Distribution) view.getAggregation()).getBucketBoundaries().getBoundaries(),
arg.getBucketCounts(),
@@ -531,14 +499,14 @@ final class StatszZPageHandler extends ZPageHandler {
new Function<LastValueDataDouble, Void>() {
@Override
public Void apply(LastValueDataDouble arg) {
- formatter.format("<td %s>%.3f</td>", ALIGN_LEFT, arg.getLastValue());
+ formatter.format("<td>%.3f</td>", arg.getLastValue());
return null;
}
},
new Function<LastValueDataLong, Void>() {
@Override
public Void apply(LastValueDataLong arg) {
- formatter.format("<td %s>%d</td>", ALIGN_LEFT, arg.getLastValue());
+ formatter.format("<td>%d</td>", arg.getLastValue());
return null;
}
},
@@ -547,10 +515,8 @@ final class StatszZPageHandler extends ZPageHandler {
public Void apply(AggregationData arg) {
if (arg instanceof AggregationData.MeanData) {
AggregationData.MeanData meanData = (AggregationData.MeanData) arg;
- formatter.format(
- "<td class=\"border-left\" %s>%.3f</td>", ALIGN_LEFT, meanData.getMean());
- formatter.format(
- "<td class=\"border-left\" %s>%d</td>", ALIGN_LEFT, meanData.getCount());
+ formatter.format("<td>%.3f</td>", meanData.getMean());
+ formatter.format("<td class=\"borderLL\">%d</td>", meanData.getCount());
return null;
}
throw new IllegalArgumentException("Unknown Aggregation.");
@@ -567,7 +533,7 @@ final class StatszZPageHandler extends ZPageHandler {
checkArgument(
bucketBoundaries.size() == bucketCounts.size() - 1,
"Bucket boundaries and counts don't match");
- out.write("<td class=\"border-left\">");
+ out.write("<td class=\"borderLL\">");
out.write("<table>");
formatter.format(
"<thead><tr><th>%s</th><th>%s</th></tr></thead>",
@@ -592,7 +558,7 @@ final class StatszZPageHandler extends ZPageHandler {
out.write("<h2>Measures with Views</h2>");
out.write("<p>Below are the measures used in registered views.</p>");
out.write("<p></p>");
- formatter.format("<table class=\"borders\" cellspacing=0 cellpadding=0>");
+ formatter.format("<table cellspacing=0 cellpadding=0>");
emitMeasureTableHeader(out, formatter);
out.write("<tbody>");
for (Entry<String, Measure> entry : measures.entrySet()) {
@@ -607,26 +573,24 @@ final class StatszZPageHandler extends ZPageHandler {
out.write("<thead>");
out.write("<tr>");
formatter.format("<th colspan=1>%s</th>", TABLE_HEADER_MEASURE);
- formatter.format("<th colspan=1 class=\"l1\" align=\"left\">%s</th>", TABLE_HEADER_DESCRIPTION);
- formatter.format("<th colspan=1 class=\"l1\" align=\"left\">%s</th>", TABLE_HEADER_UNIT);
- formatter.format(
- "<th colspan=1 class=\"l1\" align=\"left\">%s</th>", TABLE_HEADER_MEASURE_TYPE);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_DESCRIPTION);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_UNIT);
+ formatter.format("<th colspan=1 class=\"borderL\">%s</th>", TABLE_HEADER_MEASURE_TYPE);
out.write("</tr>");
out.write("</thead>");
}
private static void emitMeasureTableRow(Measure measure, PrintWriter out, Formatter formatter) {
- out.write("<tr class=\"border-bottom\">");
+ out.write("<tr>");
formatter.format("<td><b>%s</b></td>", measure.getName());
- formatter.format(
- "<td class=\"border-left\" align=\"left\">%s&nbsp;</td>", measure.getDescription());
- formatter.format("<td class=\"border-left\" align=\"left\">%s&nbsp;</td>", measure.getUnit());
+ formatter.format("<td class=\"borderLL\">%s&nbsp;</td>", measure.getDescription());
+ formatter.format("<td class=\"borderLL\">%s&nbsp;</td>", measure.getUnit());
String measureType =
measure.match(
Functions.returnConstant("Double"),
Functions.returnConstant("Long"),
Functions.throwAssertionError());
- formatter.format("<td class=\"border-left\" align=\"left\">%s&nbsp;</td>", measureType);
+ formatter.format("<td class=\"borderLL\">%s&nbsp;</td>", measureType);
out.write("</tr>");
}
diff --git a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/Style.java b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/Style.java
new file mode 100644
index 00000000..015b83df
--- /dev/null
+++ b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/Style.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2018, OpenCensus Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.opencensus.contrib.zpages;
+
+final class Style {
+ private Style() {}
+
+ static String style =
+ "body{font-family: 'Roboto',sans-serif;"
+ + "font-size: 14px;background-color: #F2F4EC;}"
+ + "h1{color: #3D3D3D;text-align: center;margin-bottom: 20px;}"
+ + "p{padding: 0 0.5em;color: #3D3D3D;}"
+ + "h2{color: #3D3D3D;font-size: 1.5em;background-color: #FFF;"
+ + "line-height: 2.0;margin-bottom: 0;padding: 0 0.5em;}"
+ + "h3{font-size:16px;padding:0 0.5em;margin-top:6px;margin-bottom:25px;}"
+ + "a{color:#A94442;}"
+ + "p.header{font-family: 'Open Sans', sans-serif;top: 0;left: 0;width: 100%;"
+ + "height: 60px;vertical-align: middle;color: #C1272D;font-size: 22pt;}"
+ + "p.view{font-size: 20px;margin-bottom: 0;}"
+ + ".header span{color: #3D3D3D;}"
+ + "img.oc{vertical-align: middle;}"
+ + "table{width: 100%;color: #FFF;background-color: #FFF;overflow: hidden;"
+ + "margin-bottom: 30px;margin-top: 0;border-bottom: 1px solid #3D3D3D;"
+ + "border-left: 1px solid #3D3D3D;border-right: 1px solid #3D3D3D;}"
+ + "table.title{width:100%;color:#3D3D3D;background-color:#FFF;"
+ + "border:none;line-height:2.0;margin-bottom:0;}"
+ + "thead{color: #FFF;background-color: #A94442;"
+ + "line-height:3.0;padding:0 0.5em;}"
+ + "th{color: #FFF;background-color: #A94442;"
+ + "line-height:3.0;padding:0 0.5em;}"
+ + "th.borderL{border-left:1px solid #FFF; text-align:left;}"
+ + "th.borderRL{border-right:1px solid #FFF; text-align:left;}"
+ + "th.borderLB{border-left:1px solid #FFF;"
+ + "border-bottom:1px solid #FFF;margin:0 10px;}"
+ + "tr.direct{font-size:16px;padding:0 0.5em;background-color:#F2F4EC;}"
+ + "tr:nth-child(even){background-color: #F2F2F2;}"
+ + "td{color: #3D3D3D;line-height: 2.0;text-align: left;padding: 0 0.5em;}"
+ + "td.borderLC{border-left:1px solid #3D3D3D;text-align:center;}"
+ + "td.borderLL{border-left:1px solid #3D3D3D;text-align:left;}"
+ + "td.borderRL{border-right:1px solid #3D3D3D;text-align:left;}"
+ + "td.borderRW{border-right:1px solid #FFF}"
+ + "td.borderLW{border-left:1px solid #FFF;}"
+ + "td.centerW{text-align:center;color:#FFF;}"
+ + "td.center{text-align:center;color:#3D3D3D;}"
+ + "tr.bgcolor{background-color:#A94442;}"
+ + "h1.left{text-align:left;margin-left:20px;}"
+ + "table.small{width:40%;background-color:#FFF;"
+ + "margin-left:20px;margin-bottom:30px;}"
+ + "table.small{width:40%;background-color:#FFF;"
+ + "margin-left:20px;margin-bottom:30px;}"
+ + "td.col_headR{background-color:#A94442;"
+ + "line-height:3.0;color:#FFF;border-right:1px solid #FFF;}"
+ + "td.col_head{background-color:#A94442;"
+ + "line-height:3.0;color:#FFF;}"
+ + "b.title{margin-left:20px;font-weight:bold;line-height:2.0;}"
+ + "input.button{margin-left:20px;margin-top:4px;"
+ + "font-size:20px;width:80px;height:60px;}"
+ + "td.head{text-align:center;color:#FFF;line-height:3.0;}";
+}
diff --git a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TraceConfigzZPageHandler.java b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TraceConfigzZPageHandler.java
index 71f7c931..2a02cca6 100644
--- a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TraceConfigzZPageHandler.java
+++ b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TraceConfigzZPageHandler.java
@@ -53,8 +53,8 @@ final class TraceConfigzZPageHandler extends ZPageHandler {
private static final String TRACECONFIGZ_FORM_BODY =
"<form action=/traceconfigz method=get>%n"
// Permanently changes table.
- + "<table class=\"margin-btm\" rules=\"all\" frame=\"border\">%n"
- + "<td colspan=\"3\" class=\"col_head_red\">Permanently change "
+ + "<table class=\"small\" rules=\"all\">%n"
+ + "<td colspan=\"3\" class=\"col_head\">Permanently change "
+ "<input type=\"hidden\" name=\"%s\" value=\"%s\"></td>%n"
+ "<tr><td>SamplingProbability to</td> "
+ "<td><input type=text size=15 name=%s value=\"\"></td> <td>(%s)</td>%n"
@@ -92,27 +92,7 @@ final class TraceConfigzZPageHandler extends ZPageHandler {
private static void emitStyle(PrintWriter out) {
out.write("<style>\n");
- out.write(
- "body{font-family:'Roboto',sans-serif;font-size:14px;" + "background-color:#F2F4EC;}\n");
- out.write("h1{color:#3D3D3D;text-align:left;margin-left:20px;" + "margin-bottom:20px;}\n");
- out.write("p{padding:0 0.5em;color:#3D3D3D}\n");
- out.write(
- "p.header{font-family:'Open Sans',sans-serif;top:0;left:0;width:100%;"
- + "height:60px;vertical-align:middle;color:#C1272D;font-size:22pt;}\n");
- out.write(".header span{color:#3D3D3D;}\n");
- out.write("img.oc {vertical-align:middle;}\n");
- out.write("table{width:40%;background-color:#FFF;margin-left:20px;}\n");
- out.write("td{line-height:2.0;padding:0 0.5em;}\n");
- out.write("td.col_head{font-size:16px;font-weight:bold;" + "line-height:3.0;color:#FFF;}\n");
- out.write("td.col_head_red{background-color:#A94442;font-size:16px;\n");
- out.write("font-weight:bold;line-height:3.0;color:#FFF;}\n");
- out.write("b.title{margin-left:20px;font-weight:bold;line-height:2.0;}\n");
- out.write("input.button{margin-left:20px;margin-top:4px;\n");
- out.write("font-size:20px;width:80px;height:60px;}\n");
- out.write("table.margin-btm{margin-bottom:30px;}\n");
- out.write("table.borders{border-left:1px solid #3D3D3D;" + "border-right:1px solid #3D3D3D;\n");
- out.write("border-bottom:1px solid #3D3D3D;}\n");
- out.write("table.borders-all{border:1px solid #3D3D3D;}\n");
+ out.write(Style.style);
out.write("</style>\n");
}
@@ -125,7 +105,7 @@ final class TraceConfigzZPageHandler extends ZPageHandler {
out.write("<html lang=\"en\"><head>\n");
out.write("<meta charset=\"utf-8\">\n");
out.write("<title>TraceConfigZ</title>\n");
- out.write("<link rel=\"shortcut icon\" href=\"//www.opencensus.io/favicon.ico\"/>\n");
+ out.write("<link rel=\"shortcut icon\" href=\"https://opencensus.io/images/favicon.ico\"/>\n");
out.write(
"<link href=\"https://fonts.googleapis.com/css?family=Open+Sans:300\""
+ "rel=\"stylesheet\">\n");
@@ -138,7 +118,7 @@ final class TraceConfigzZPageHandler extends ZPageHandler {
"<p class=\"header\">"
+ "<img class=\"oc\" src=\"https://opencensus.io/img/logo-sm.svg\" />"
+ "Open<span>Census</span></p>");
- out.write("<h1>Trace Configuration</h1>");
+ out.write("<h1 class=\"left\">Trace Configuration</h1>");
out.write("<p></p>");
try {
// Work that can throw exceptions.
@@ -213,9 +193,9 @@ final class TraceConfigzZPageHandler extends ZPageHandler {
private static void emitTraceParamsTable(TraceParams params, PrintWriter out) {
out.write(
"<b class=\"title\">Active tracing parameters:</b><br>\n"
- + "<table class=\"margin-btm\" rules=\"all\" frame=\"border\">\n"
- + " <tr style=\"background:#A94442;border=1\">\n"
- + " <td class=\"col_head\">Name</td>\n"
+ + "<table class=\"small\" rules=\"all\">\n"
+ + " <tr>\n"
+ + " <td class=\"col_headR\">Name</td>\n"
+ " <td class=\"col_head\">Value</td>\n"
+ " </tr>\n");
out.printf(
diff --git a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TracezZPageHandler.java b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TracezZPageHandler.java
index 8c1aedae..a5092416 100644
--- a/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TracezZPageHandler.java
+++ b/contrib/zpages/src/main/java/io/opencensus/contrib/zpages/TracezZPageHandler.java
@@ -109,7 +109,7 @@ final class TracezZPageHandler extends ZPageHandler {
private static final String TRACEZ_URL = "/tracez";
private static final Tracer tracer = Tracing.getTracer();
// Color to use for zebra-striping.
- private static final String ZEBRA_STRIPE_COLOR = "#F2F2F2";
+ private static final String ZEBRA_STRIPE_COLOR = "#FFF";
// Color for sampled traceIds.
private static final String SAMPLED_TRACE_ID_COLOR = "#C1272D";
// Color for not sampled traceIds
@@ -155,28 +155,7 @@ final class TracezZPageHandler extends ZPageHandler {
private static void emitStyle(PrintWriter out) {
out.write("<style>\n");
- out.write(
- "body {font-family:'Roboto',sans-serif;font-size:14px;" + "background-color:#F2F4EC;}\n");
- out.write("h1{color:#3D3D3D;text-align:center; margin-bottom:20px;}\n");
- out.write("p{padding:0 0.5em;color: #3D3D3D}\n");
- out.write(
- "p.header{font-family:'Open Sans',sans-serif;top:0;left:0;width:100%;"
- + "height:60px;vertical-align:middle;color:#C1272D;font-size:22pt;}\n");
- out.write(".header span{color:#3D3D3D;}\n");
- out.write("img.oc{ vertical-align:middle;}\n");
- out.write(
- "table{color:#FFF;background-color:#FFF;overflow:hidden;"
- + "width:100%;margin-bottom:30px;}\n");
- out.write("th{line-height:3.0;padding:0 0.5em;}\n");
- out.write("tr.border td{border-bottom:1px solid #3D3D3D;}\n");
- out.write("tr.bgcolor_red{background-color:#A94442;}\n");
- out.write("td.column_head{text-align:center;color:#FFF;line-height:3.0;}\n");
- out.write("td{color:#3D3D3D;line-height:2.0;padding:0 0.5em;}\n");
- out.write("a{color:#A94442;}\n");
- out.write("td.border-right{border-right:1px solid #FFF;}\n");
- out.write("td.border-left{border-left:1px solid #FFF;}\n");
- out.write("td.border-left-blk{border-left:1px solid #000}\n");
- out.write("td.border-right-blk{border-right:1px solid #000}\n");
+ out.write(Style.style);
out.write("</style>\n");
}
@@ -188,7 +167,7 @@ final class TracezZPageHandler extends ZPageHandler {
out.write("<html lang=\"en\"><head>\n");
out.write("<meta charset=\"utf-8\">\n");
out.write("<title>TraceZ</title>\n");
- out.write("<link rel=\"shortcut icon\" href=\"//www.opencensus.io/favicon.ico\"/>\n");
+ out.write("<link rel=\"shortcut icon\" href=\"https://opencensus.io/images/favicon.ico\"/>\n");
out.write(
"<link href=\"https://fonts.googleapis.com/css?family=Open+Sans:300\""
+ "rel=\"stylesheet\">\n");
@@ -460,7 +439,7 @@ final class TracezZPageHandler extends ZPageHandler {
formatter.format("<td>%s</td>%n", htmlEscaper().escape(spanName));
// Running
- out.write("<td class=\"border-right-blk\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td class=\"borderRL\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
RunningSpanStore.PerSpanNameSummary runningSpanStorePerSpanNameSummary =
runningSpanStoreSummary.getPerSpanNameSummary().get(spanName);
@@ -479,7 +458,7 @@ final class TracezZPageHandler extends ZPageHandler {
sampledSpanStoreSummary.getPerSpanNameSummary().get(spanName);
// Latency based samples
- out.write("<td class=\"border-left-blk\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td class=\"borderLC\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
Map<LatencyBucketBoundaries, Integer> latencyBucketsSummaries =
sampledSpanStorePerSpanNameSummary != null
? sampledSpanStorePerSpanNameSummary.getNumbersOfLatencySampledSpans()
@@ -499,7 +478,7 @@ final class TracezZPageHandler extends ZPageHandler {
}
// Error based samples.
- out.write("<td class=\"border-right-blk\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td class=\"borderRL\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
if (sampledSpanStorePerSpanNameSummary != null) {
Map<CanonicalCode, Integer> errorBucketsSummaries =
sampledSpanStorePerSpanNameSummary.getNumbersOfErrorSampledSpans();
@@ -521,27 +500,27 @@ final class TracezZPageHandler extends ZPageHandler {
private static void emitSummaryTableHeader(PrintWriter out, Formatter formatter) {
// First line.
- out.write("<tr class=\"bgcolor_red\">\n");
- out.write("<td colspan=1 class=\"column_head\"><b>Span Name</b></td>\n");
- out.write("<td class=\"border-right\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
- out.write("<td colspan=1 class=\"column_head\"><b>Running</b></td>\n");
- out.write("<td class=\"border-left\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
- out.write("<td colspan=9 class=\"column_head\"><b>Latency Samples</b></td>\n");
- out.write("<td class=\"border-right\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
- out.write("<td colspan=1 class=\"column_head\"><b>Error Samples</b></td>\n");
+ out.write("<tr class=\"bgcolor\">\n");
+ out.write("<td colspan=1 class=\"head\"><b>Span Name</b></td>\n");
+ out.write("<td class=\"borderRW\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td colspan=1 class=\"head\"><b>Running</b></td>\n");
+ out.write("<td class=\"borderLW\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td colspan=9 class=\"head\"><b>Latency Samples</b></td>\n");
+ out.write("<td class=\"borderRW\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td colspan=1 class=\"head\"><b>Error Samples</b></td>\n");
out.write("</tr>\n");
// Second line.
- out.write("<tr class=\"bgcolor_red\">\n");
+ out.write("<tr class=\"bgcolor\">\n");
out.write("<td colspan=1></td>\n");
- out.write("<td class=\"border-right\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td class=\"borderRW\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
out.write("<td colspan=1></td>\n");
- out.write("<td class=\"border-left\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td class=\"borderLW\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
for (LatencyBucketBoundaries latencyBucketsBoundaries : LatencyBucketBoundaries.values()) {
formatter.format(
- "<td colspan=1 align=\"center\" style=\"color:#FFF\"><b>[%s]</b></td>%n",
+ "<td colspan=1 class=\"centerW\"><b>[%s]</b></td>%n",
LATENCY_BUCKET_BOUNDARIES_STRING_MAP.get(latencyBucketsBoundaries));
}
- out.write("<td class=\"border-right\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+ out.write("<td class=\"borderRW\">&nbsp;&nbsp;&nbsp;&nbsp;</td>");
out.write("<td colspan=1></td>\n");
out.write("</tr>\n");
}
@@ -558,7 +537,7 @@ final class TracezZPageHandler extends ZPageHandler {
throws UnsupportedEncodingException {
if (numSamples > 0) {
formatter.format(
- "<td align=\"center\"><a href='?%s=%s&%s=%d&%s=%d'>%d</a></td>%n",
+ "<td class=\"center\"><a href='?%s=%s&%s=%d&%s=%d'>%d</a></td>%n",
HEADER_SPAN_NAME,
URLEncoder.encode(spanName, "UTF-8"),
HEADER_SAMPLES_TYPE,
@@ -567,9 +546,9 @@ final class TracezZPageHandler extends ZPageHandler {
subtype,
numSamples);
} else if (numSamples < 0) {
- out.write("<td align=\"center\">N/A</td>\n");
+ out.write("<td class=\"center\">N/A</td>\n");
} else {
- out.write("<td align=\"center\">0</td>\n");
+ out.write("<td class=\"center\">0</td>\n");
}
}
diff --git a/contrib/zpages/src/resources/style.css b/contrib/zpages/src/resources/style.css
deleted file mode 100644
index 36a08970..00000000
--- a/contrib/zpages/src/resources/style.css
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ================================================
- Zpages CSS 04/10/2018
-===================================================
-
- 1. TYPOGRAPHY
- 2. GLOBAL STYLES
- 3. HEADER
- 4. TABLE
-
-=================================================== */
-
-/* -------------------------------------------
- 1. TYPOGRAPHY
----------------------------------------------- */
-/* FONTS */
-@import url('https://fonts.googleapis.com/css?family=Open+Sans|Roboto');
-
-/* -------------------------------------------
- 2. GLOBAL STYLES
----------------------------------------------- */
-body {
- font-family: 'Roboto',sans-serif;
- font-size: 14px;
- background-color: #F2F4EC;
-}
-h1 {
- color: #3D3D3D;
- text-align: center;
- margin-bottom: 20px;
-}
-p {
- padding: 0 0.5em;
- color: #3D3D3D;
-}
-h2 {
- color: #3D3D3D;
- font-size: 1.5em;
- background-color: #FFF;
- line-height: 2.0;
- margin-bottom: 0;
- padding: 0 0.5em;
-}
-h3 {
- font-size:16px;
- padding:0 0.5em;
- margin-top:4px;
- margin-bottom:25px;
-}
-a {
- color:#A94442;
-}
-
-/* -------------------------------------------
- 3. HEADER
----------------------------------------------- */
-p.header {
- font-family: 'Open Sans', sans-serif;
- top: 0;
- left: 0;
- width: 100%;
- height: 60px;
- vertical-align: middle;
- color: #C1272D;
- font-size: 22pt;
-}
-.header span {
- color: #3D3D3D;
-}
-img.oc {
- vertical-align: middle;
-}
-
-/* -------------------------------------------
- 4. TABLE
----------------------------------------------- */
-table {
- width: 100%;
- color: #FFF;
- background-color: #FFF;
- overflow: hidden;
- margin-bottom: 30px;
- margin-top: 0;
- border-bottom: 1px solid #3D3D3D;
- border-left: 1px solid #3D3D3D;
- border-right: 1px solid #3D3D3D;
-}
-thead {
- background-color: #A94442;
-}
-th {
- background-color: #A94442;
-}
-tr:nth-child(even) {
- background-color: #F2F2F2;
-}
-td {
- color: #3D3D3D;
- line-height: 2.0;
- text-align: left;
- padding: 0 0.5em;
-}
-