aboutsummaryrefslogtreecommitdiffstats
path: root/examples/src
diff options
context:
space:
mode:
authorBogdan Drutu <bdrutu@google.com>2017-08-16 18:56:27 -0700
committerGitHub <noreply@github.com>2017-08-16 18:56:27 -0700
commita77f1b63f3229caa850d17758dfe67c662538c9b (patch)
tree71fc02ecb5504f652bf43910a5c6fcc1394155d0 /examples/src
parent468ece14992f5ca91df4686c637ca8dcda48a26e (diff)
downloadplatform_external_opencensus-java-a77f1b63f3229caa850d17758dfe67c662538c9b.tar.gz
platform_external_opencensus-java-a77f1b63f3229caa850d17758dfe67c662538c9b.tar.bz2
platform_external_opencensus-java-a77f1b63f3229caa850d17758dfe67c662538c9b.zip
Add initial implementation of the tracez page. (#517)
* Add initial implementation of the tracez page. * Fix HTML when premature return. Add DOCTYPE and charset. * URLEncode the given spanName. * Build zpages only for java8. * Move Tester->ZPagesTester, add tests for query parsing. * Fix more comments.
Diffstat (limited to 'examples/src')
-rw-r--r--examples/src/main/java/io/opencensus/examples/zpages/ZPagesTester.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/src/main/java/io/opencensus/examples/zpages/ZPagesTester.java b/examples/src/main/java/io/opencensus/examples/zpages/ZPagesTester.java
new file mode 100644
index 00000000..1d59e3b4
--- /dev/null
+++ b/examples/src/main/java/io/opencensus/examples/zpages/ZPagesTester.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017, Google Inc.
+ * 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.examples.zpages;
+
+import com.sun.net.httpserver.HttpServer;
+import io.opencensus.zpages.TracezHttpHandler;
+import java.net.InetSocketAddress;
+import java.util.logging.Logger;
+
+/**
+ * Testing only class for the UI.
+ */
+public class ZPagesTester {
+ private static final Logger logger = Logger.getLogger(ZPagesTester.class.getName());
+
+ /** Main method. */
+ public static void main(String[] args) throws Exception {
+ HttpServer server = HttpServer.create(new InetSocketAddress(8000), 10);
+ TracezHttpHandler.register(server);
+ server.start();
+ logger.info(server.getAddress().toString());
+ }
+
+}