1. 提交部分代码
This commit is contained in:
parent
1dd349037b
commit
59d3f15dbe
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<String, AnlyResult> resultMap = new Gson().fromJson(jsonObject.getAsJsonObject("summaryValueMap"),
|
||||
new TypeToken<Map<String, AnlyResult>>() {
|
||||
}.getType());
|
||||
anlyResult = resultMap.get(loadKey);
|
||||
if (anlyResult == null){
|
||||
if (anlyResult == null) {
|
||||
anlyResult = new AnlyResult();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<TypicalCallTreeNode> treeNodes;
|
||||
private Map<String, TypicalCallTreeNode> treeNodes;
|
||||
|
||||
|
||||
public TypicalCallTree(String callTreeId) {
|
||||
this.callTreeId = callTreeId;
|
||||
this.treeNodes = new ArrayList<TypicalCallTreeNode>();
|
||||
this.treeNodes = new HashMap<String, TypicalCallTreeNode>();
|
||||
}
|
||||
|
||||
public void addNode(TypicalCallTreeNode typicalCallTreeNode) {
|
||||
this.treeNodes.add(typicalCallTreeNode);
|
||||
this.treeNodes.put(typicalCallTreeNode.getNodeToken(), typicalCallTreeNode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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("<span class='highlight-viewpoint'>");
|
||||
result.append(searchKey);
|
||||
result.append("</span>");
|
||||
|
|
@ -57,15 +61,4 @@ public class ViewPointBeautiUtil {
|
|||
return result.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> 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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
});
|
||||
}
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<hr/>
|
||||
</script>
|
||||
</#macro>
|
||||
|
||||
|
|
@ -54,7 +55,33 @@
|
|||
{{if isPrintLevelId}}
|
||||
<td rowspan="{{>rowSpanCount}}" valign="middle">{{>traceLevelId}}</td>
|
||||
{{/if}}
|
||||
<td><a href="#">{{>viewPoint}}<a></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" data-toggle="modal" data-target="#modal{{>nodeToken}}">{{>viewPoint}}</a>
|
||||
<div class="modal fade" id="modal{{>nodeToken}}" tabindex="-1" role="dialog" aria-labelledby="modal{{>modalId}}Label">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">节点详情</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class= "row">
|
||||
<div class="col-md-10">
|
||||
<label>viewpoint:</label><br/>
|
||||
<span style="word-wrap:break-word;">{{>viewPointStr}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button name="showTypicalCallTreeBtn" type="button" class="btn btn-primary" value="{{>nodeToken}}">查看调用链</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{>anlyResult.totalCall}}</td>
|
||||
<td>{{>anlyResult.correctNumber}}</td>
|
||||
<td>
|
||||
|
|
@ -68,8 +95,111 @@
|
|||
{{/if}}
|
||||
">
|
||||
<strong>{{>anlyResult.correctRate}}%</strong></span></td>
|
||||
<td>{{>anlyResult.averageCost}}ms</td>
|
||||
</tr>
|
||||
<td>{{>anlyResult.averageCost}}ms
|
||||
<span id="{{>nodeToken}}" style="display:none">{{>anlyResultStr}}</span></td>
|
||||
|
||||
</tr>
|
||||
</script>
|
||||
</#macro>
|
||||
</#macro>
|
||||
|
||||
<#macro typicalCallChainTrees>
|
||||
<script type="text/x-jsrender" id="typicalCallChainTreesTmpl">
|
||||
<br/>
|
||||
<div class="row">
|
||||
<small> <a>http://aisse-mobile-web/Aisse-Mobile-Web/aisseWorkPage/backOvertimeInit</a> </small>
|
||||
<br/>
|
||||
<small> com.ai.aisse.controller.overtimeexpense.Ov...t(HttpServletRequest,HttpServletResponse,ModelMap)</small>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<span> 归属该节点下所有的典型调用链:</span>
|
||||
<input type="checkbox"/>典型调用链1
|
||||
<input type="checkbox">典型调用链2</input>
|
||||
<input type="checkbox">典型调用链3</input>
|
||||
</div>
|
||||
<br/>
|
||||
<table class="gridtable" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>LevelId</th>
|
||||
<th>ViewPoint</th>
|
||||
<th>应用</th>
|
||||
<th>调用次数</th>
|
||||
<th>正确次数</th>
|
||||
<th>错误次数</th>
|
||||
<th>正确率</th>
|
||||
<th>平均耗时</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dataBody">
|
||||
<tr id="a">
|
||||
<td>0</td>
|
||||
<td>Http://localhost:8080/order/save1</td>
|
||||
<td>Order-Application</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>0</td>
|
||||
<td>100%</td>
|
||||
<td>20.0ms</td>
|
||||
</tr>
|
||||
<tr id="b">
|
||||
<td valign="middle">0.0</td>
|
||||
<td> <a id="popBtn" data-toggle="modal" data-target="#myModal">com.ai.aisse.core.service.impl...taServiceImpl.SynchAisseData()</a></td>
|
||||
<td>Account-Application</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>0</td>
|
||||
<td>100%</td>
|
||||
<td>20.0ms</td>
|
||||
</tr>
|
||||
<tr id="c">
|
||||
<td valign="middle">0.0</td>
|
||||
<td> <a>com.ai.aisse.core.dao.impl.Syn...taDaoImpl.queryAppAisseTimer()</a></td>
|
||||
<td>Biling-Application</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>0</td>
|
||||
<td>100%</td>
|
||||
<td>20.0ms</td>
|
||||
</tr>
|
||||
<tr id="d">
|
||||
<td>0.2</td>
|
||||
<td> <a>tracing:jdbc:oracle:thin:@10.1.1.61:1521:OAPROD(aisse)</a></td>
|
||||
<td>Order-Application</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>0</td>
|
||||
<td>100%</td>
|
||||
<td>20.0ms</td>
|
||||
</tr>
|
||||
<tr id="e">
|
||||
<td valign="middle">0.3</td>
|
||||
<td> <a>com.ai.aisse.core.dao.impl.Syn...AisseTimer(java.sql.Timestamp)</a></td>
|
||||
<td>Order-Application</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>0</td>
|
||||
<td>100%</td>
|
||||
<td>20.0ms</td>
|
||||
</tr>
|
||||
<tr id="f">
|
||||
<td valign="middle">0.0</td>
|
||||
<td> <a>tracing:jdbc:oracle:thin:@10.1.1.61:1521:OAPROD(aisse)</a></td>
|
||||
<td>Order-Application</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>0</td>
|
||||
<td>100%</td>
|
||||
<td>20.0ms</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
</#macro>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,14 +19,16 @@
|
|||
<script src="${_base}/bower_components/skywalking/js/tracelog.js"></script>
|
||||
<script src="${_base}/bower_components/skywalking/js/application.js"></script>
|
||||
<script src="${_base}/bower_components/skywalking/js/analysisSearchResult.js"></script>
|
||||
<script src="${_base}/bower_components/skywalking/js/analysisResult.js"></script>
|
||||
<#--<script src="${_base}/bower_components/skywalking/js/analysisResult.js"></script>-->
|
||||
<script src="${_base}/bower_components/skywalking/js/analysisResultViewResovler.js"></script>
|
||||
<script src="${_base}/bower_components/smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<link href="${_base}/bower_components/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
|
||||
<link href="${_base}/bower_components/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"
|
||||
rel="stylesheet">
|
||||
<link href="${_base}/bower_components/bootstrap-toggle/css/bootstrap-toggle.min.css" rel="stylesheet">
|
||||
<script src="${_base}/bower_components/bootstrap-toggle/js/bootstrap-toggle.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="padding-top:100px">
|
||||
<body style="padding-top:80px">
|
||||
<@common.navbar/>
|
||||
<!--Trace Info -->
|
||||
<@traceInfo.traceTableTmpl/>
|
||||
|
|
@ -43,6 +45,7 @@
|
|||
<@anlySearchResult.pageInfoTmpl/>
|
||||
<@anlyResult.analysisResult/>
|
||||
<@anlyResult.analysisResultTableTmpl/>
|
||||
<@anlyResult.typicalCallChainTrees/>
|
||||
<p id="baseUrl" style="display: none">${_base}</p>
|
||||
<div class="container" id="mainPanel">
|
||||
<p id="searchType" style="display: none">${searchType!''}</p>
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue