This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x by this push: new 447e065 PHOENIX-6143: Get Phoenix Tracing Webapp work 447e065 is described below commit 447e0650c56ecbf8d496a449f359460a537a1835 Author: Tamas Penzes <tam...@cloudera.com> AuthorDate: Thu Sep 17 22:21:17 2020 +0200 PHOENIX-6143: Get Phoenix Tracing Webapp work Tracing webapp was broken for a while, these changes get it work. --- phoenix-tracing-webapp/README.md | 6 +- phoenix-tracing-webapp/pom.xml | 70 ++++++++++++---------- .../src/build/trace-server-runnable.xml | 13 ++++ .../src/main/webapp/partials/about.html | 2 +- .../src/main/webapp/partials/home.html | 4 +- .../src/main/webapp/partials/phoenix-trace.html | 2 +- .../test/webapp/js/specs/trace-list-ctrl-spec.js | 42 +++++++------ pom.xml | 5 ++ 8 files changed, 88 insertions(+), 56 deletions(-) diff --git a/phoenix-tracing-webapp/README.md b/phoenix-tracing-webapp/README.md index d2af448..458d71c 100755 --- a/phoenix-tracing-webapp/README.md +++ b/phoenix-tracing-webapp/README.md @@ -1,12 +1,12 @@ # TracingWebApp 1. Build the web application- - *mvn clean install* + `mvn clean install` 2. Start the TracingWebApp - *java -jar target/phoenix-tracing-webapp-4.5.0-SNAPSHOT-runnable.jar* + `java -jar target/phoenix-tracing-webapp-<version>-runnable.jar` 3. View the Content - - *http://localhost:8864/webapp/#* + *http://localhost:8864/* ###Note You can set the port of the trace app by -Dphoenix.traceserver.http.port={portNo} diff --git a/phoenix-tracing-webapp/pom.xml b/phoenix-tracing-webapp/pom.xml index 176f318..59f971c 100755 --- a/phoenix-tracing-webapp/pom.xml +++ b/phoenix-tracing-webapp/pom.xml @@ -31,45 +31,54 @@ <properties> <top.dir>${project.basedir}/..</top.dir> + + <!-- tracing webapp only versions --> + <servlet.api.version>3.1.0</servlet.api.version> + <jetty.version>9.3.27.v20190418</jetty.version> </properties> <dependencies> <dependency> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <version>${servlet.api.version}</version> + </dependency> + <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> - <!-- TODO : pick the same jetty version throughout the project (PHOENIX-2211)--> - <version>${jettyVersion}</version> + <version>${jetty.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-util</artifactId> + <version>${jetty.version}</version> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> - <!-- TODO : pick the same jetty version throughout the project (PHOENIX-2211)--> - <version>${jettyVersion}</version> + <version>${jetty.version}</version> </dependency> <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-common</artifactId> - <scope>provided</scope> - </dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> <dependency> - <groupId>org.apache.phoenix</groupId> - <artifactId>phoenix-core</artifactId> - <scope>provided</scope> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>compile</scope> </dependency> <dependency> - <groupId>org.apache.hbase</groupId> - <artifactId>hbase-common</artifactId> + <groupId>org.apache.phoenix</groupId> + <artifactId>phoenix-core</artifactId> <scope>provided</scope> </dependency> <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <scope>provided</scope> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-common</artifactId> </dependency> <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <scope>provided</scope> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-common</artifactId> </dependency> </dependencies> @@ -107,7 +116,6 @@ <plugin> <groupId>com.github.searls</groupId> <artifactId>jasmine-maven-plugin</artifactId> - <version>1.3.1.6</version> <executions> <execution> <goals> @@ -138,17 +146,17 @@ <jsTestSrcDir>${basedir}/src/test/webapp/js/specs</jsTestSrcDir> </configuration> </plugin> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <configuration> - <excludes> - <exclude>**/webapp/**</exclude> - <exclude>**/*.xml</exclude> - <exclude>**/README.md</exclude> - </excludes> - </configuration> - </plugin> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/webapp/**</exclude> + <exclude>**/*.xml</exclude> + <exclude>**/README.md</exclude> + </excludes> + </configuration> + </plugin> </plugins> </build> diff --git a/phoenix-tracing-webapp/src/build/trace-server-runnable.xml b/phoenix-tracing-webapp/src/build/trace-server-runnable.xml index d099b03..83ba35a 100755 --- a/phoenix-tracing-webapp/src/build/trace-server-runnable.xml +++ b/phoenix-tracing-webapp/src/build/trace-server-runnable.xml @@ -43,7 +43,20 @@ <outputDirectory>/</outputDirectory> <includes> <include>org.apache.phoenix:phoenix-tracing-webapp</include> + <include>org.apache.hbase:hbase-common</include> + <include>org.apache.hadoop:hadoop-common</include> + <include>javax.servlet:javax.servlet-api</include> <include>org.eclipse.jetty:*</include> + <include>org.slf4j:slf4j-api</include> + <include>org.slf4j:slf4j-log4j12</include> + <include>log4j:log4j</include> + <include>com.fasterxml.jackson.core:jackson-databind</include> + <include>com.fasterxml.woodstox:woodstox-core</include> + <include>org.codehaus.woodstox:stax2-api</include> + <include>com.google.guava:guava</include> + <include>commons-collections:commons-collections</include> + <include>commons-cli:commons-cli</include> + <include>commons-logging:commons-logging</include> </includes> </dependencySet> </dependencySets> diff --git a/phoenix-tracing-webapp/src/main/webapp/partials/about.html b/phoenix-tracing-webapp/src/main/webapp/partials/about.html index 9dc76d7..637b7a7 100755 --- a/phoenix-tracing-webapp/src/main/webapp/partials/about.html +++ b/phoenix-tracing-webapp/src/main/webapp/partials/about.html @@ -6,5 +6,5 @@ <div class="page-header"> <p>The tracing web app for Apache Phoenix contains features list, dependency tree, trace count, trace distribution and timeline.</p> <p>In List the most recent traces are listed down. The limiting value is used to determine the trace count displayed. With each trace there is an option to view either the dependency tree or the timeline.The dependency tree views the traces belonging to a trace id in a tree view. The trace id is the input to the system. The parent child relationship of the traces can be viewed clearly. The tooltip gives the host name, parent id, span id,start time,end time, description and duration. Each [...] -<p>The trace count chart can be viewed as pie charts, line charts, bar charts and area charts. The chart changing option is collapseble and could be hidden. The trace distribution chart shows the traces across phoenix hosts on which they are running. The charts used are pie charts, line charts, bar charts and area charts. The chart changing option is collapseble and could be hidden. In the traces can be viewed along the timeline for a given trace id. Traces can be added or cleared from t [...] +<p>The trace count chart can be viewed as pie charts, line charts, bar charts and area charts. The chart changing option is collapseble and could be hidden. The trace distribution chart shows the traces across Phoenix hosts on which they are running. The charts used are pie charts, line charts, bar charts and area charts. The chart changing option is collapseble and could be hidden. In the traces can be viewed along the timeline for a given trace id. Traces can be added or cleared from t [...] </div> \ No newline at end of file diff --git a/phoenix-tracing-webapp/src/main/webapp/partials/home.html b/phoenix-tracing-webapp/src/main/webapp/partials/home.html index 4473af2..d65b571 100755 --- a/phoenix-tracing-webapp/src/main/webapp/partials/home.html +++ b/phoenix-tracing-webapp/src/main/webapp/partials/home.html @@ -5,8 +5,8 @@ all they way from the client through into the HBase side, and back again.</p> </div> <div class="page-header"> - <h4><span class="label label-success">Apache Phoenix</span> is sql query engine for Apache Hbase.</h4> - <h4>It helps managing and querying the Hbase tables. The web app is used to visualize the tracing information. It helps to predict and analyze query information and system matrices</h4> + <h4><span class="label label-success">Apache Phoenix</span> is a SQL query engine for Apache HBase.</h4> + <h4>It helps managing and querying the HBase tables. The web app is used to visualize the tracing information. It helps to predict and analyze query information and system matrices</h4> <h4><span class="label label-success">The Apache Phoenix Tracing Web app</span> has 5 features.</h4> diff --git a/phoenix-tracing-webapp/src/main/webapp/partials/phoenix-trace.html b/phoenix-tracing-webapp/src/main/webapp/partials/phoenix-trace.html index 08e38ac..73eea33 100644 --- a/phoenix-tracing-webapp/src/main/webapp/partials/phoenix-trace.html +++ b/phoenix-tracing-webapp/src/main/webapp/partials/phoenix-trace.html @@ -29,7 +29,7 @@ <div class="thumbnail"> <div class="caption"> <h3><i class="fa fa-pie-chart"></i> Trace Distribution</h3> - <p>The trace distribution chart shows the traces across phoenix hosts on which they are running. The charts used are pie charts, line charts, bar charts and area charts. The chart changing option is collapseble and could be hidden.</p> + <p>The trace distribution chart shows the traces across Phoenix hosts on which they are running. The charts used are pie charts, line charts, bar charts and area charts. The chart changing option is collapseble and could be hidden.</p> <p><a href="#trace-distribution" class="btn btn-primary" role="button">View</a> </div> </div> diff --git a/phoenix-tracing-webapp/src/test/webapp/js/specs/trace-list-ctrl-spec.js b/phoenix-tracing-webapp/src/test/webapp/js/specs/trace-list-ctrl-spec.js index c2866e0..e2eeb00 100644 --- a/phoenix-tracing-webapp/src/test/webapp/js/specs/trace-list-ctrl-spec.js +++ b/phoenix-tracing-webapp/src/test/webapp/js/specs/trace-list-ctrl-spec.js @@ -18,6 +18,12 @@ 'use strict'; +var scope +var traceListCtrl +var httpBackend +var authRequestHandler +var rootScope +var createController describe('TracingCtrl', function() { @@ -32,9 +38,9 @@ describe('TracingCtrl', function() { beforeEach(inject(function($injector) { // Set up the mock http service responses - $httpBackend = $injector.get('$httpBackend'); + httpBackend = $injector.get('$httpBackend'); // backend definition common for trace of phoenix - authRequestHandler = $httpBackend.when('GET', '../trace?action=getall&limit=100') + authRequestHandler = httpBackend.when('GET', '../trace?action=getall&limit=100') .respond([{ "start_time": 1438582622482, "trace_id": -9223359832482284828, @@ -46,13 +52,13 @@ describe('TracingCtrl', function() { "description": "Committing mutations to tables" }]); // Get hold of a scope (i.e. the root scope) - $rootScope = $injector.get('$rootScope'); + rootScope = $injector.get('$rootScope'); // The $controller service is used to create instances of controllers var $controller = $injector.get('$controller'); createController = function() { return $controller('TraceListCtrl', { - '$scope': $rootScope + '$scope': rootScope }); }; })); @@ -79,29 +85,29 @@ describe('TracingCtrl', function() { }); it('should fetch trace from phoenix', function() { - $httpBackend.expectGET('../trace?action=getall&limit=100'); + httpBackend.expectGET('../trace?action=getall&limit=100'); var controller = createController(); - $httpBackend.flush(); + httpBackend.flush(); }); it('updating trace list after retriving phoenix trace', function() { var controller = createController(); - $httpBackend.flush(); - expect($rootScope.traces).toBeDefined(); - expect($rootScope.traces.length).toBe(1); + httpBackend.flush(); + expect(rootScope.traces).toBeDefined(); + expect(rootScope.traces.length).toBe(1); }); it('checking trace list attributes of phoenix trace', function() { var controller = createController(); - $httpBackend.flush(); - expect($rootScope.traces[0].start_time).toBe(1438582622482); - expect($rootScope.traces[0].trace_id).toBe(-9223359832482284828); - expect($rootScope.traces[0].hostname).toBe('pc'); - expect($rootScope.traces[0].span_id).toBe(-876665211183522462); - expect($rootScope.traces[0].parent_id).toBe(-4694507801564472011); - expect($rootScope.traces[0].end_time).toBe(1438582622483); - expect($rootScope.traces[0].count).toBe(0); - expect($rootScope.traces[0].description).toBe('Committing mutations to tables'); + httpBackend.flush(); + expect(rootScope.traces[0].start_time).toBe(1438582622482); + expect(rootScope.traces[0].trace_id).toBe(-9223359832482284828); + expect(rootScope.traces[0].hostname).toBe('pc'); + expect(rootScope.traces[0].span_id).toBe(-876665211183522462); + expect(rootScope.traces[0].parent_id).toBe(-4694507801564472011); + expect(rootScope.traces[0].end_time).toBe(1438582622483); + expect(rootScope.traces[0].count).toBe(0); + expect(rootScope.traces[0].description).toBe('Committing mutations to tables'); }); }); diff --git a/pom.xml b/pom.xml index 7aa95c8..8aa3dfe 100644 --- a/pom.xml +++ b/pom.xml @@ -183,6 +183,11 @@ </configuration> </plugin> <plugin> + <groupId>com.github.searls</groupId> + <artifactId>jasmine-maven-plugin</artifactId> + <version>2.2</version> + </plugin> + <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> <version>${spotbugs-maven-plugin.version}</version>