| <%doc> |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you 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. |
| </%doc> |
| <%args> |
| QueryInfo queryInfo; |
| HiveConf hiveConf; |
| </%args> |
| <%import> |
| java.util.*; |
| org.apache.hadoop.hive.ql.QueryDisplay; |
| org.apache.hadoop.hive.ql.QueryInfo; |
| org.apache.hadoop.hive.conf.HiveConf; |
| </%import> |
| <!--[if IE]> |
| <!DOCTYPE html> |
| <![endif]--> |
| <?xml version="1.0" encoding="UTF-8" ?> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <title>HiveServer2</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="description" content=""> |
| |
| <link href="/static/css/bootstrap.min.css" rel="stylesheet"> |
| <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"> |
| <link href="/static/css/hive.css" rel="stylesheet"> |
| </head> |
| |
| <body> |
| <div class="navbar navbar-fixed-top navbar-default"> |
| <div class="container"> |
| <div class="navbar-header"> |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| <a class="navbar-brand" href="/hiveserver2.jsp"><img src="/static/hive_logo.jpeg" alt="Hive Logo"/></a> |
| </div> |
| <div class="collapse navbar-collapse"> |
| <ul class="nav navbar-nav"> |
| <li class="active"><a href="/">Home</a></li> |
| <li><a href="/logs/">Local logs</a></li> |
| <li><a href="/jmx">Metrics Dump</a></li> |
| <li><a href="/conf">Hive Configuration</a></li> |
| <li><a href="/stacks">Stack Trace</a></li> |
| </ul> |
| </div><!--/.nav-collapse --> |
| </div> |
| </div> |
| </div> |
| |
| |
| <%if queryInfo == null %> |
| <div class="jumbotron"> |
| <p>Query not found. It may have been deleted, increase <i>hive.server2.webui.max.historic.queries</i> |
| to retain more historic query information.</p> |
| </div> |
| <%else> |
| |
| |
| <div class="container"> |
| <div class="row inner_header"> |
| <div class="page-header"> |
| <h1>Query Information: <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryString() %></h1> |
| </div> |
| </div> |
| <div class="row"> |
| |
| |
| <div class="tabbable"> |
| <ul class="nav nav-pills"> |
| <li class="active"><a href="#tab_baseProfile" data-toggle="tab">Base Profile</a></li> |
| <li class=""><a href="#tab_stages" data-toggle="tab">Stages</a></li> |
| <li class=""><a href="#tab_queryPlan" data-toggle="tab">Query Plan</a></li> |
| <li class=""><a href="#tab_perfLogging" data-toggle="tab">Performance Logging</a></li> |
| </ul> |
| <div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;"> |
| <div class="tab-pane active" id="tab_baseProfile"> |
| <& baseProfile; queryInfo = queryInfo &> |
| </div> |
| <div class="tab-pane" id="tab_stages"> |
| <& stages; queryInfo = queryInfo &> |
| </div> |
| <div class="tab-pane" id="tab_queryPlan"> |
| <& queryPlan; queryInfo = queryInfo &> |
| </div> |
| <div class="tab-pane" id="tab_perfLogging"> |
| <& perfLogging; queryInfo = queryInfo &> |
| </div> |
| </div> |
| </div> |
| |
| </%if> |
| |
| </div> |
| </div> |
| <script src="/static/js/jquery.min.js" type="text/javascript"></script> |
| <script src="/static/js/bootstrap.min.js" type="text/javascript"></script> |
| <script src="/static/js/tab.js" type="text/javascript"></script> |
| </body> |
| </html> |
| |
| <%def baseProfile> |
| <%args> |
| QueryInfo queryInfo; |
| </%args> |
| <table class="table table-striped"> |
| <tr> |
| <td>User Name</td> |
| <td><% queryInfo.getUserName() %></td> |
| </tr> |
| <tr> |
| <td>Query String</td> |
| <td><% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryString() %></td> |
| </tr> |
| <tr> |
| <td>Id</td> |
| <td><% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryId() %></td> |
| </tr> |
| <tr> |
| <td>Execution Engine</td> |
| <td><% queryInfo.getExecutionEngine() %> |
| </tr> |
| <tr> |
| <td>State</td> |
| <td><% queryInfo.getState() %></td> |
| </tr> |
| <tr> |
| <td>Opened Timestamp</td> |
| <td><% new Date(queryInfo.getBeginTime()) %></td> |
| </tr> |
| <tr> |
| <td>Opened (s)</td> |
| <td><% queryInfo.getElapsedTime()/1000 %></td> |
| </tr> |
| <tr> |
| <td>Closed Timestamp</td> |
| <td><% queryInfo.getEndTime() == null ? "Open" : new Date(queryInfo.getEndTime()) %></td> |
| </tr> |
| <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getErrorMessage() != null %> |
| <tr> |
| <td>Error</td> |
| <td><% queryInfo.getQueryDisplay().getErrorMessage() %></td> |
| </tr> |
| </%if> |
| <tr> |
| <td>Latency (s)</td> |
| <td><% queryInfo.getRuntime() == null ? "Not finished" : queryInfo.getRuntime()/1000 %></td> |
| </tr> |
| </table> |
| </%def> |
| |
| <%def stages> |
| <%args> |
| QueryInfo queryInfo; |
| </%args> |
| <table class="table table-striped"> |
| <tr> |
| <th>Stage Id</th> |
| <th>Status</th> |
| <th>Begin Time</th> |
| <th>End Time</th> |
| <th>Elapsed Time (s)</th> |
| <th>Requires Lock</th> |
| </tr> |
| |
| <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getTaskDisplays() != null %> |
| <%for QueryDisplay.TaskDisplay taskDisplay : queryInfo.getQueryDisplay().getTaskDisplays() %> |
| <tr> |
| <td><% taskDisplay.getTaskId() + ":" + taskDisplay.getTaskType() %></td> |
| <td><% taskDisplay.getStatus() %></td> |
| <td><% taskDisplay.getBeginTime() == null ? "" : new Date(taskDisplay.getBeginTime()) %></td> |
| <td><% taskDisplay.getEndTime() == null ? "" : new Date(taskDisplay.getEndTime()) %></td> |
| <td><% taskDisplay.getElapsedTime() == null ? "" : taskDisplay.getElapsedTime()/1000 %> (s) </td> |
| <td><% taskDisplay.isRequireLock() %></td> |
| </tr> |
| </%for> |
| </%if> |
| </table> |
| </%def> |
| |
| |
| <%def queryPlan> |
| <%args> |
| QueryInfo queryInfo; |
| </%args> |
| <div class="panel panel-default"> |
| <div class="panel-heading">Explain plan</div> |
| <div class="panel-body"> |
| <%if hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_LOG_EXPLAIN_OUTPUT) %> |
| <pre> |
| <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getExplainPlan() %> |
| </pre> |
| <%else> |
| <pre> |
| Set configuration hive.log.explain.output to true to view future query plans |
| </pre> |
| </%if> |
| </div> |
| </div> |
| </%def> |
| |
| |
| <%def perfLogging> |
| <%args> |
| QueryInfo queryInfo; |
| </%args> |
| <section> |
| <h3>Compile-time metadata operations</h3> |
| <table class="table table-striped"> |
| <tr> |
| <th>Call Name</th> |
| <th>Time (ms)</th> |
| </tr> |
| |
| <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION) != null %> |
| <%for Map.Entry<String, Long> time : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION).entrySet() %> |
| <tr> |
| <td><% time.getKey() %></td> |
| <td><% time.getValue() %></td> |
| </tr> |
| </%for> |
| </%if> |
| </table> |
| </section> |
| |
| <section> |
| <h3>Execution-time metadata operations</h3> |
| <table class="table table-striped"> |
| <tr> |
| <th>Call Name</th> |
| <th>Time (ms)</th> |
| </tr> |
| |
| <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION) != null %> |
| <%for Map.Entry<String, Long> time : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION).entrySet() %> |
| <tr> |
| <td><% time.getKey() %></td> |
| <td><% time.getValue() %></td> |
| </tr> |
| </%for> |
| </%if> |
| </table> |
| </section> |
| |
| <section> |
| <h3>Compile-Time Perf-Logger</h3> |
| <table class="table table-striped"> |
| <tr> |
| <th>Compile-time Call Name</th> |
| <th>Time (ms)</th> |
| </tr> |
| |
| <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION) != null %> |
| <%for Map.Entry<String, Long> time : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION).entrySet() %> |
| <tr> |
| <td><% time.getKey() %></td> |
| <td><% time.getValue() %></td> |
| </tr> |
| </%for> |
| </%if> |
| </table> |
| </section> |
| |
| <section> |
| <h3>Execution-Time Perf-Logger</h3> |
| <table class="table table-striped"> |
| <tr> |
| <th>Execution-time Call Name</th> |
| <th>Time (ms)</th> |
| </tr> |
| |
| <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION) != null %> |
| <%for Map.Entry<String, Long> time : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION).entrySet() %> |
| <tr> |
| <td><% time.getKey() %></td> |
| <td><% time.getValue() %></td> |
| </tr> |
| </%for> |
| </%if> |
| </table> |
| </section> |
| </%def> |
| |
| </div> |
| </div> |
| <script src="/static/js/jquery.min.js" type="text/javascript"></script> |
| <script src="/static/js/bootstrap.min.js" type="text/javascript"></script> |
| <script src="/static/js/tab.js" type="text/javascript"></script> |
| </body> |
| </html> |