children = root.getChildren();
+ if (children!=null&&children.size()>0) {
+ children.forEach(child->{
+ String childKey = child.getClassName()+"."+child.getMethodName();
+ RunTimeNode newChild = getTree(childKey);
+ if (newChild!=null) {
+ child.setChildren(newChild.getChildren());
+ child.setValue(child.getAvgRunTime());
+ }
+ });
+ }
+ return root;
+ }
+}
diff --git a/src/main/resources/static/config.js b/src/main/resources/static/config.js
new file mode 100644
index 0000000..fe7e610
--- /dev/null
+++ b/src/main/resources/static/config.js
@@ -0,0 +1,98 @@
+function getOption(data){
+ return {
+ tooltip: {
+ trigger: 'item',
+ triggerOn: 'mousemove'
+ },
+ series: [
+ {
+ type: 'tree',
+ // initialTreeDepth: 3,
+ data: [data],
+ top: '1%',
+ left: '15%',
+ bottom: '1%',
+ right: '10%',
+ roam: true,
+ symbolSize: 20,
+ itemStyle: {
+ borderColor: 'green'
+ },
+
+ label: {
+ position: 'right',
+ formatter: function(params){
+ var bg = "titleBgGreen"
+ if (params.value>800) {
+ bg = "titleBgRed"
+ }
+ return [
+ '{'+bg+'| 指标}',
+ ' {aa|}方法:'+params.name+" ",
+ '{hr|}',
+ ' {aa|}耗时: '+params.data.avgRunTime+" ms ",
+ '{hr|}',
+ ' {aa|}类型: '+params.data.methodType+" "
+ ].join('\n');
+ },
+ backgroundColor: '#ddd',
+ borderColor: '#88e781',
+ borderWidth: 1,
+ borderRadius: 5,
+ color: '#000',
+ fontSize: 12,
+ rich: {
+ titleBgGreen: {
+ align: 'left',
+ backgroundColor: '#59977e',
+ height: 20,
+ borderRadius: [5, 5, 0, 0],
+ padding: [0, 0, 0, 0],
+ width: '100%',
+ color: '#eee'
+ },
+ titleBgRed: {
+ align: 'left',
+ backgroundColor: '#dc1d16',
+ height: 20,
+ borderRadius: [5, 5, 0, 0],
+ padding: [0, 0, 0, 0],
+ width: '100%',
+ color: '#eee'
+ },
+ hr: {
+ borderColor: '#777',
+ width: '100%',
+ borderWidth: 0.5,
+ height: 0
+ },
+ aa: {
+ lineHeight: 20,
+ borderColor: '#111111',
+ height: 20,
+ borderRadius: [5, 5, 0, 0],
+ padding: [0, 0, 0, 0],
+ width: '0%'
+
+ },
+ t: {
+ align: 'center'
+ }
+ }
+ },
+
+ leaves: {
+ label: {
+ position: 'right',
+ verticalAlign: 'middle',
+ align: 'left'
+ }
+ },
+ expandAndCollapse: true,
+ animationDuration: 550,
+ animationDurationUpdate: 750
+ }
+ ]
+ }
+}
+
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 0fd8f71..7c80943 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -48,15 +48,15 @@
-
-
${system.avgRunTime}
+ ${system.avgRunTime}
平均响应(ms)
-
-
${system.maxRunTime}
+ ${system.maxRunTime}
最大响应(ms)
-
-
${system.minRunTime}
+ ${system.minRunTime}
最小响应(ms)
@@ -68,7 +68,7 @@
${runtime.className}#${runtime.methodName} 
- layui-bg-red
<#else>layui-bg-green
#if>">平均响应 ${runtime.avgRunTime} 毫秒
@@ -100,26 +100,18 @@
-
-
-
-
-
-
-
-
-
+
+