From 59d3f15dbe64df6c3b06666bb1f014f632997760 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Tue, 10 May 2016 21:07:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/dao/impl/TypicalCallTreeDaoImpl.java | 11 +- .../skywalking/web/dto/CallChainTreeNode.java | 4 +- .../skywalking/web/dto/TypicalCallTree.java | 10 +- .../web/dto/TypicalCallTreeNode.java | 19 +- .../web/util/ViewPointBeautiUtil.java | 17 +- ...esult.js => analysisResultViewResovler.js} | 386 ++++++++++-------- .../pages/anls-result/analysisResult.ftl | 138 ++++++- .../src/main/webapp/pages/main.ftl | 16 +- 8 files changed, 399 insertions(+), 202 deletions(-) rename skywalking-webui/src/main/webapp/bower_components/skywalking/js/{analysisResult.js => analysisResultViewResovler.js} (59%) diff --git a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dao/impl/TypicalCallTreeDaoImpl.java b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dao/impl/TypicalCallTreeDaoImpl.java index bdb733017..43e09a085 100644 --- a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dao/impl/TypicalCallTreeDaoImpl.java +++ b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dao/impl/TypicalCallTreeDaoImpl.java @@ -5,6 +5,8 @@ import com.ai.cloud.skywalking.web.dto.TypicalCallTree; import com.ai.cloud.skywalking.web.dto.TypicalCallTreeNode; import com.ai.cloud.skywalking.web.util.HBaseUtils; import com.alibaba.fastjson.JSONArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; @@ -50,9 +52,12 @@ public class TypicalCallTreeDaoImpl implements ITypicalCallTreeDao { } TypicalCallTree callTree = new TypicalCallTree(callTreeId); for (Cell cell : r.rawCells()) { - String levelId = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()); - String viewPoint = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()); - callTree.addNode(new TypicalCallTreeNode(levelId, viewPoint)); + String valueStr = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()); + JsonObject jsonObject = (JsonObject) new JsonParser().parse(valueStr); + //TypicalCallTreeNode node = new Gson().fromJson(valueStr, TypicalCallTreeNode.class); + TypicalCallTreeNode node = new TypicalCallTreeNode(jsonObject.get("parentLevelId").getAsString(), + jsonObject.get("levelId").getAsString(), jsonObject.get("viewPoint").getAsString()); + callTree.addNode(node); } return callTree; } diff --git a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/CallChainTreeNode.java b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/CallChainTreeNode.java index f8db878e5..eb9da8823 100644 --- a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/CallChainTreeNode.java +++ b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/CallChainTreeNode.java @@ -17,18 +17,20 @@ public class CallChainTreeNode { private String nodeToken; private String traceLevelId; private String viewPoint; + private String viewPointStr; private AnlyResult anlyResult; public CallChainTreeNode(String qualifierStr, String valueStr, String loadKey) { traceLevelId = qualifierStr.substring(0, qualifierStr.indexOf("@")); viewPoint = qualifierStr.substring(qualifierStr.indexOf("@") + 1); + viewPointStr = viewPoint; nodeToken = TokenGenerator.generate(traceLevelId + ":" + viewPoint); JsonObject jsonObject = (JsonObject) new JsonParser().parse(valueStr); Map resultMap = new Gson().fromJson(jsonObject.getAsJsonObject("summaryValueMap"), new TypeToken>() { }.getType()); anlyResult = resultMap.get(loadKey); - if (anlyResult == null){ + if (anlyResult == null) { anlyResult = new AnlyResult(); } } diff --git a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTree.java b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTree.java index 94943a8cd..4dbe76d8c 100644 --- a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTree.java +++ b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTree.java @@ -1,22 +1,22 @@ package com.ai.cloud.skywalking.web.dto; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; /** * Created by xin on 16-4-28. */ public class TypicalCallTree { private String callTreeId; - private List treeNodes; + private Map treeNodes; public TypicalCallTree(String callTreeId) { this.callTreeId = callTreeId; - this.treeNodes = new ArrayList(); + this.treeNodes = new HashMap(); } public void addNode(TypicalCallTreeNode typicalCallTreeNode) { - this.treeNodes.add(typicalCallTreeNode); + this.treeNodes.put(typicalCallTreeNode.getNodeToken(), typicalCallTreeNode); } } diff --git a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTreeNode.java b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTreeNode.java index d56fbd777..c22bd5f06 100644 --- a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTreeNode.java +++ b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/dto/TypicalCallTreeNode.java @@ -1,5 +1,6 @@ package com.ai.cloud.skywalking.web.dto; +import com.ai.cloud.skywalking.web.util.StringUtil; import com.ai.cloud.skywalking.web.util.TokenGenerator; /** @@ -7,13 +8,21 @@ import com.ai.cloud.skywalking.web.util.TokenGenerator; */ public class TypicalCallTreeNode { private String nodeToken; + private String viewPoint; private String levelId; - private String viewpoint; + public TypicalCallTreeNode(String parentLevelId, String levelId, String viewPoint) { + if (StringUtil.isBlank(parentLevelId)){ + this.levelId = levelId; + }else{ + this.levelId = parentLevelId + "." + levelId; + } - public TypicalCallTreeNode(String levelId, String viewPoint) { - this.levelId = levelId; - this.viewpoint = viewPoint; - this.nodeToken = TokenGenerator.generate(levelId + ":" + viewPoint); + this.viewPoint = viewPoint; + nodeToken = TokenGenerator.generate(levelId + ":" + viewPoint); + } + + public String getNodeToken() { + return nodeToken; } } diff --git a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/util/ViewPointBeautiUtil.java b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/util/ViewPointBeautiUtil.java index 7d4204a77..1507e97af 100644 --- a/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/util/ViewPointBeautiUtil.java +++ b/skywalking-webui/src/main/java/com/ai/cloud/skywalking/web/util/ViewPointBeautiUtil.java @@ -19,7 +19,11 @@ public class ViewPointBeautiUtil { if (index == -1) { return viewPoint; } - StringBuilder result = new StringBuilder(viewPoint.substring(0, index - 1)); + StringBuilder result = new StringBuilder(); + if (index > 0) { + result = new StringBuilder(viewPoint.substring(0, index - 1)); + } + result.append(""); result.append(searchKey); result.append(""); @@ -57,15 +61,4 @@ public class ViewPointBeautiUtil { return result.toString(); } - public static void main(String[] args) { - List list = new ArrayList<>(); - list.add("tracing:jdbc:oracle:thin:@10.1.1.61:1521:OAPROD(aisse)preaparedStatement.executeQuery:select a.ACCOUNT_TYPE,a.PHONE_ACCOUNT,a.PHONE_NUMBER,a.ATTRIBUTE4 from AISSE_EMPLOYEE_MOBILE_INFO_V a where PHONE_NUMBER is not null and NT_ACCOUNT = ? and ACCOUNT_TYPE not in ('统一充值','United Voucher'):preaparedStatement.executeQuery:select a.ACCOUNT_TYPE,a.PHONE_ACCOUNT,a.PHONE_NUMBER,a.ATTRIBUTE4 from AISSE_EMPLOYEE_MOBILE_INFO_V a where PHONE_NUMBER is not null and NT_ACCOUNT = ? and ACCOUNT_TYPE not in ('统一充值','United Voucher')"); - list.add("tracing:jdbc:oracle:thin:@10.1.1.61:1521:OAPROD(aisse)preaparedStatement.executeQuery:select a.ACCOUNT_TYPE,a.PHONE_ACCOUNT,a.PHONE_NUMBER,a.ATTRIBUTE4 from AISSE_EMPLOYEE_MOBILE_INFO_V a where lower(a.NT_ACCOUNT) = ?:preaparedStatement.executeQuery:select a.ACCOUNT_TYPE,a.PHONE_ACCOUNT,a.PHONE_NUMBER,a.ATTRIBUTE4 from AISSE_EMPLOYEE_MOBILE_INFO_V a where lower(a.NT_ACCOUNT) = ?"); - list.add("dubbo://aisse-mobile-web/com.ai.aisse.core.rest.ExpenseInitApi.searchMembersinfo(String):"); - list.add("com.ai.aisse.core.dao.impl.QueryUserMessageDaoImpl.selectDemoList(java.lang.String):"); - list.add("com.ai.aisse.controller.common.CommonController.toAisseMobilePage(com.ai.net.xss.wrapper.XssRequestWrapper,org.apache.catalina.connector.ResponseFacade,org.springframework.validation.support.BindingAwareModelMap):"); - for (String string : list) { - System.out.println(beautifulViewPoint(string, "ACCOUNT_TYPE")); - } - } } diff --git a/skywalking-webui/src/main/webapp/bower_components/skywalking/js/analysisResult.js b/skywalking-webui/src/main/webapp/bower_components/skywalking/js/analysisResultViewResovler.js similarity index 59% rename from skywalking-webui/src/main/webapp/bower_components/skywalking/js/analysisResult.js rename to skywalking-webui/src/main/webapp/bower_components/skywalking/js/analysisResultViewResovler.js index 5bbe41646..69520c69a 100644 --- a/skywalking-webui/src/main/webapp/bower_components/skywalking/js/analysisResult.js +++ b/skywalking-webui/src/main/webapp/bower_components/skywalking/js/analysisResultViewResovler.js @@ -1,6 +1,11 @@ -function initAnalysisResult() { - +function AnalysisResultViewResolver(param) { + AnalysisResultViewResolver.prototype.baseUrl = param.baseUrl; + AnalysisResultViewResolver.prototype.treeId = param.treeId; + this.bindEvent(); +} +AnalysisResultViewResolver.prototype.bindEvent = function () { + var self = this; $('#analyDate').datetimepicker({ format: 'yyyy-mm-dd', startView: 2, @@ -8,31 +13,213 @@ function initAnalysisResult() { autoclose: true }); - $("#previousHourBtn").click(function () { - var analyType = "HOUR"; - var analyDate = getPreviousHour(); - paintAnalysisResult($("#treeId").val(), analyType, analyDate) + this.bindHotSearchLink(); + this.bindEventForSearchDateInput(); + + $("a[name='analyTypeDropDownOption'][value='MONTH']").click(); + $("#analyDate").val(this.getCurrentMonth()); + + $("#showAnalyResultBtn").click(function () { + self.loadData($("#analyType").val(), $("#analyDate").val()); + }); + $("#showAnalyResultBtn").click(); + + +} + + +AnalysisResultViewResolver.prototype.callChainTreeData = []; +AnalysisResultViewResolver.prototype.callEntrance = {}; +AnalysisResultViewResolver.prototype.typicCallChainData = []; +AnalysisResultViewResolver.prototype.currentTypicalTreeNodeMapping = []; + +AnalysisResultViewResolver.prototype.showTypicalCallTree = function (nodeToken) { + + + for (var i = 0; i < this.typicCallChainData.length; i++) { + var node = this.typicCallChainData[i]; + var tmpInfo = node.treeNodes[nodeToken]; + if (tmpInfo == undefined || tmpInfo == "") { + continue; + } + + var tmpTypicalCallChain = {}; + tmpTypicalCallChain.callTreeId = node.callTreeId; + for (var key in node.treeNodes) { + var tmpNode = node.treeNodes[key]; + tmpNode.analyResult = JSON.parse($("#" + key).text()); + tmpTypicalCallChain.nodes.push(tmpNode); + } + this.currentTypicalTreeNodeMapping.push(tmpTypicalCallChain); + } + + alert(currentTypicalTreeNodeMapping); + +} + +AnalysisResultViewResolver.prototype.loadData = function (analyType, analyDate) { + var self = this; + var analysisResultUrl = this.baseUrl + "/analy/load/" + this.treeId + "/" + + analyType + "/" + analyDate; + $.ajax({ + type: 'POST', + url: analysisResultUrl, + dataType: 'json', + async: true, + success: function (data) { + if (data.code == '200') { + self.callChainTreeData = self.convertAnalysisResult(jQuery.parseJSON(data.result)); + var template = $.templates("#analysisResultTableTmpl"); + var htmlOutput = template.render(self.callChainTreeData); + $("#dataBody").empty(); + $("#dataBody").html(htmlOutput); + + $("button[name='showTypicalCallTreeBtn']").each(function () { + $(this).click(function () { + var treeNode = $(this).attr("value"); + $(".modal-backdrop").remove(); + self.showTypicalCallTree(treeNode); + + var template = $.templates("#typicalCallChainTreesTmpl"); + var htmlOutput = template.render({}); + $("#mainPanel").empty(); + $("#mainPanel").html(htmlOutput); + }) + }); + } + }, + error: function () { + $("#errorMessage").text("Fatal Error, please try it again."); + $("#alertMessageBox").show(); + } }); - $("#yesterdayBtn").click(function () { - var analyType = "DAY"; - var analyDate = getYesterday(); - paintAnalysisResult($("#treeId").val(), analyType, analyDate) - }); + var typicCallTreeUrl = this.baseUrl + "/analy/load/" + this.treeId + "/" + analyDate; + $.ajax({ + type: 'POST', + url: typicCallTreeUrl, + dataType: 'json', + async: true, + success: function (data) { + if (data.code == '200') { + self.typicCallChainData = jQuery.parseJSON(data.result); + } + }, + error: function () { + $("#errorMessage").text("Fatal Error, please try it again."); + $("#alertMessageBox").show(); + } + }) +} - $("#currentMonthBtn").click(function () { - var analyType = "MONTH"; - var analyDate = getCurrentMonth(); - paintAnalysisResult($("#treeId").val(), analyType, analyDate) - }); +AnalysisResultViewResolver.prototype.convertAnalysisResult = function (originData) { + if (originData == undefined || originData.callChainTreeNodeList == undefined) { + return []; + } + var previousNodeLevelId = ""; + var index = -1; + var count = 1; + var flag = false; + for (var i = 0; i < originData.callChainTreeNodeList.length; i++) { + var node = originData.callChainTreeNodeList[i]; + if (node.traceLevelId == "0") { + self.callEntrance = node; + } - $("#previousMonthBtn").click(function () { - var analyType = "MONTH"; - var analyDate = getPreviousMonth(); - paintAnalysisResult($("#treeId").val(), analyType, analyDate) - }); + if (previousNodeLevelId == node.traceLevelId) { + if (count == 1) { + index = i - 1; + } + count++; + flag = true; + } + + if (flag) { + originData.callChainTreeNodeList[i].isPrintLevelId = false; + originData.callChainTreeNodeList[index].rowSpanCount = count; + flag = false; + } else { + count = 1; + originData.callChainTreeNodeList[i].rowSpanCount = count; + originData.callChainTreeNodeList[i].isPrintLevelId = true; + } + + if (node.anlyResult.totalCall > 0) { + node.anlyResult.correctRate = + (parseFloat(node.anlyResult.correctNumber) + / parseFloat(node.anlyResult.totalCall) * 100).toFixed(2); + + node.anlyResult.averageCost = + (parseFloat(node.anlyResult.totalCostTime) + / parseFloat(node.anlyResult.totalCall)).toFixed(2); + } else { + node.anlyResult.correctRate = (0).toFixed(2); + node.anlyResult.averageCost = (0).toFixed(2); + } + node.anlyResultStr = JSON.stringify(node.anlyResult); + previousNodeLevelId = node.traceLevelId; + } + + return originData.callChainTreeNodeList; +} +AnalysisResultViewResolver.prototype.getPreviousHour = function () { + var date = new Date(); + var seperator1 = "-"; + var seperator2 = ":"; + var month = date.getMonth() + 1; + var strDate = date.getDate(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + return date.getFullYear() + seperator1 + month + seperator1 + strDate + seperator2 + (date.getHours() - 1); +} + +AnalysisResultViewResolver.prototype.getYesterday = function () { + var date = new Date(); + var seperator1 = "-"; + var month = date.getMonth() + 1; + var strDate = date.getDate() - 1; + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + return date.getFullYear() + seperator1 + month + seperator1 + strDate; +} + +AnalysisResultViewResolver.prototype.getCurrentMonth = function () { + var date = new Date(); + var seperator1 = "-"; + var month = date.getMonth() + 1; + if (month >= 1 && month <= 9) { + month = "0" + month; + } + return date.getFullYear() + seperator1 + month; +} + +AnalysisResultViewResolver.prototype.getPreviousMonth = function () { + var date = new Date(); + var seperator1 = "-"; + var month = date.getMonth(); + var year = date.getFullYear(); + if (month == 0) { + year = date.getFullYear() - 1; + month = 12; + } + if (month >= 1 && month <= 9) { + month = "0" + month; + } + return year + seperator1 + month; +} + + +AnalysisResultViewResolver.prototype.bindEventForSearchDateInput = function () { $("a[name='analyTypeDropDownOption']").each(function () { $(this).click(function () { $('#analyDate').val(""); @@ -64,156 +251,23 @@ function initAnalysisResult() { $("#analyType").val(value); }); }); +} - $("a[name='analyTypeDropDownOption'][value='MONTH']").click(); - $("#analyDate").val(getCurrentMonth()); - - $("#showAnalyResultBtn").click(function () { - paintAnalysisResult($("#treeId").val(), $("#analyType").val(), $("#analyDate").val()) +AnalysisResultViewResolver.prototype.bindHotSearchLink = function () { + var self = this; + $("#previousHourBtn").click(function () { + self.loadData("HOUR", self.getPreviousHour()) }); - $("#showAnalyResultBtn").click(); -} - -function paintAnalysisResult(treeId, analyType, analyDate) { - var baseUrl = $("#baseUrl").text(); - var analysisResultUrl = baseUrl + "/analy/load/" + treeId + "/" + - analyType + "/" + analyDate; - $.ajax({ - type: 'POST', - url: analysisResultUrl, - dataType: 'json', - async: true, - success: function (data) { - if (data.code == '200') { - var dataResult = convertAnalysisResult(jQuery.parseJSON(data.result)); - var template = $.templates("#analysisResultTableTmpl"); - var htmlOutput = template.render(dataResult); - $("#dataBody").empty(); - $("#dataBody").html(htmlOutput); - } - }, - error: function () { - $("#errorMessage").text("Fatal Error, please try it again."); - $("#alertMessageBox").show(); - } + $("#yesterdayBtn").click(function () { + self.loadData("DAY", self.getYesterday()) }); - var typicalCallUrl = baseUrl + "/analy/load/" + treeId + "/" + analyDate; - $.ajax({ - type: 'POST', - url: typicalCallUrl, - dataType: 'json', - async: true, - success: function (data) { - if (data.code == '200') { - //data.result - } - }, - error: function () { - $("#errorMessage").text("Fatal Error, please try it again."); - $("#alertMessageBox").show(); - } + $("#currentMonthBtn").click(function () { + self.loadData("MONTH", self.getCurrentMonth()) }); -} -function convertAnalysisResult(originData) { - if (originData == undefined || originData.callChainTreeNodeList == undefined) { - return []; - } - var previousNodeLevelId = ""; - var index = -1; - var count = 1; - var flag = false; - for (var i = 0; i < originData.callChainTreeNodeList.length; i++) { - var node = originData.callChainTreeNodeList[i]; - - if (previousNodeLevelId == node.traceLevelId) { - if (count == 1) { - index = i - 1; - } - count++; - flag = true; - } - - if (flag){ - originData.callChainTreeNodeList[i].isPrintLevelId = false; - originData.callChainTreeNodeList[index].rowSpanCount = count; - flag = false; - }else{ - count = 1; - originData.callChainTreeNodeList[i].rowSpanCount = count; - originData.callChainTreeNodeList[i].isPrintLevelId = true; - } - - if (node.anlyResult.totalCall > 0) { - node.anlyResult.correctRate = - (parseFloat(node.anlyResult.correctNumber) - / parseFloat(node.anlyResult.totalCall) * 100).toFixed(2); - - node.anlyResult.averageCost = - (parseFloat(node.anlyResult.totalCostTime) - / parseFloat(node.anlyResult.totalCall)).toFixed(2); - } else { - node.anlyResult.correctRate = (0).toFixed(2); - node.anlyResult.averageCost = (0).toFixed(2); - } - previousNodeLevelId = node.traceLevelId; - } - - return originData.callChainTreeNodeList; -} - -function getPreviousHour() { - var date = new Date(); - var seperator1 = "-"; - var seperator2 = ":"; - var month = date.getMonth() + 1; - var strDate = date.getDate(); - if (month >= 1 && month <= 9) { - month = "0" + month; - } - if (strDate >= 0 && strDate <= 9) { - strDate = "0" + strDate; - } - return date.getFullYear() + seperator1 + month + seperator1 + strDate + seperator2 + (date.getHours() - 1); -} - -function getYesterday() { - var date = new Date(); - var seperator1 = "-"; - var month = date.getMonth() + 1; - var strDate = date.getDate() - 1; - if (month >= 1 && month <= 9) { - month = "0" + month; - } - if (strDate >= 0 && strDate <= 9) { - strDate = "0" + strDate; - } - return date.getFullYear() + seperator1 + month + seperator1 + strDate; -} - -function getCurrentMonth() { - var date = new Date(); - var seperator1 = "-"; - var month = date.getMonth() + 1; - if (month >= 1 && month <= 9) { - month = "0" + month; - } - return date.getFullYear() + seperator1 + month; -} - -function getPreviousMonth() { - var date = new Date(); - var seperator1 = "-"; - var month = date.getMonth(); - var year = date.getFullYear(); - if (month == 0) { - year = date.getFullYear() - 1; - month = 12; - } - if (month >= 1 && month <= 9) { - month = "0" + month; - } - return year + seperator1 + month; + $("#previousMonthBtn").click(function () { + self.loadData("MONTH", self.getPreviousMonth()) + }); } \ No newline at end of file diff --git a/skywalking-webui/src/main/webapp/pages/anls-result/analysisResult.ftl b/skywalking-webui/src/main/webapp/pages/anls-result/analysisResult.ftl index 00e2164d9..9c19dea0a 100644 --- a/skywalking-webui/src/main/webapp/pages/anls-result/analysisResult.ftl +++ b/skywalking-webui/src/main/webapp/pages/anls-result/analysisResult.ftl @@ -45,6 +45,7 @@ +
@@ -54,7 +55,33 @@ {{if isPrintLevelId}} {{>traceLevelId}} {{/if}} - {{>viewPoint}} + + {{>viewPoint}} + + {{>anlyResult.totalCall}} {{>anlyResult.correctNumber}} @@ -68,8 +95,111 @@ {{/if}} "> {{>anlyResult.correctRate}}% - {{>anlyResult.averageCost}}ms - + {{>anlyResult.averageCost}}ms + + - \ No newline at end of file + + +<#macro typicalCallChainTrees> + + + + diff --git a/skywalking-webui/src/main/webapp/pages/main.ftl b/skywalking-webui/src/main/webapp/pages/main.ftl index 76593f3ae..41d9b14e9 100644 --- a/skywalking-webui/src/main/webapp/pages/main.ftl +++ b/skywalking-webui/src/main/webapp/pages/main.ftl @@ -19,14 +19,16 @@ - +<#----> + - + - + <@common.navbar/> <@traceInfo.traceTableTmpl/> @@ -43,6 +45,7 @@ <@anlySearchResult.pageInfoTmpl/> <@anlyResult.analysisResult/> <@anlyResult.analysisResultTableTmpl/> +<@anlyResult.typicalCallChainTrees/>
@@ -59,14 +62,15 @@ var searchKey = $("#searchKey").val(); if (searchKey.match(/viewpoint:*/i)) { loadContent("showAnlySearchResult") - } else if (searchKey.match(/analysisresult:*/i)){ + } else if (searchKey.match(/analysisresult:*/i)) { loadContent("showAnalysisResult"); - } else{ + } else { loadContent("showTraceInfo"); } }) }); + var viewResolver; function loadContent(loadType, param) { if (loadType == "showTraceInfo") { @@ -99,7 +103,7 @@ var htmlOutput = template.render({treeId: searchKey}); $("#mainPanel").empty(); $("#mainPanel").html(htmlOutput); - initAnalysisResult() + viewResolver = new AnalysisResultViewResolver({baseUrl: "${_base}", treeId: searchKey}) return; }