Commit 3743acf6 authored by meng.cheng's avatar meng.cheng

备份

parent 122059de
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "${path}",
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 4,
"iteration": 1653464761206,
"links": [],
"panels": [
{
"content": "",
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 14,
"links": [],
"mode": "markdown",
"title": "${path}",
"type": "text"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"fill": 3,
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 1
},
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_host",
"groupBy": [
{
"params": [
"1h"
],
"type": "time"
},
{
"params": [
"host"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT count(\"traceId\") FROM \"autogen\".\"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/ AND \"path\" =~ /^$path$/) AND $timeFilter GROUP BY time(5m) fill(0)",
"rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"traceId"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
},
{
"condition": "AND",
"key": "path",
"operator": "=~",
"value": "/^$path$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "接口访问量",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "reqps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"content": "<span id= \"path\" style=\"display:none;\">$path</span>\n<div id=\"main\"></div>\n<style>html { overflow-y:hidden; }</style>\n<script>\nvar currentDiv = document.getElementById(\"main\");\nvar path = document.getElementById(\"path\").innerHTML\nvar xAxisData = [];\nvar myChart = echarts.init(currentDiv);\nvar colors = ['#5793f3', '#d14a61', '#675bba'];\nvar option = {\n color: colors,\n title: {\n text: '',\n textStyle: {\n color: \"#FFFFFF\"\n }\n },\n tooltip: {\n trigger: 'none',\n axisPointer: {\n type: 'cross'\n }\n },\n legend: {\n data: ['昨天', '今天'],\n textStyle: {\n color: \"#FFFFFF\"\n }\n },\n grid: {\n top: 70,\n bottom: 50\n },\n textStyle: {\n color: \"#FFFFFF\"\n },\n xAxis: [\n {\n type: 'category',\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n onZero: false,\n lineStyle: {\n color: colors[1]\n }\n },\n axisPointer: {\n label: {\n formatter: function (params) {\n return '访问量: ' + params.value\n + (params.seriesData.length ? ':' + params.seriesData[0].data : '');\n }\n }\n },\n data: xAxisData\n },\n {\n type: 'category',\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n onZero: false,\n lineStyle: {\n color: colors[0]\n }\n },\n axisPointer: {\n label: {\n formatter: function (params) {\n return '访问量: ' + params.value\n + (params.seriesData.length ? ':' + params.seriesData[0].data : '');\n }\n }\n },\n data: xAxisData\n }\n ],\n yAxis: [\n {\n type: 'value',\n min: 'dataMin',\n scale: true\n }\n ],\n series: [\n {\n name: \"昨天\",\n type: 'line',\n xAxisIndex: 1,\n smooth: true\n },\n {\n name: \"今天\",\n type: 'line',\n smooth: true\n }\n ]\n};\n//每5分钟采一个点\nvar interval = 5;\nvar dayOfSecond = 86400;\n//每分钟刷新一次\nvar loadDataInterVal = 60 * 1000;\nvar pointLen = dayOfSecond/interval/60 + 1;\nvar url = 'http://172.20.6.33:3000/api/datasources/proxy/1/query';\nvar params = { db: 'monitor', epoch: 'ms' };\n//毫秒\nvar now = Date.now();\nvar todayZero = new Date(new Date().setHours(0, 0, 0, 0)).getTime();\nvar yesterdayZero = todayZero - 86400000;\nvar yesterdayQuery = \"select count(traceId) from trace_info where path = '\" + path + \"' and time >= \" + fillingWithZero(yesterdayZero)\n + \" and time <= \" + fillingWithZero(todayZero - 1)\n + \" group by time(\" + interval + \"m) fill(0);\";\n\n// 5分钟刷新一次\nloadData();\nsetInterval(\"loadData()\", loadDataInterVal);\n\nfunction loadData() {\n axios.get(url,\n { params: { db: 'monitor', q: yesterdayQuery + generatorTodayQuery(), epoch: 'ms', } })\n .then(function (rs) {\n var yesterdayData = rs.data.results[0].series[0].values\n var todayData = rs.data.results[1].series[0].values\n resize();\n generatorX();\n option.series[0].data = dealResult(yesterdayData);\n option.series[1].data = dealResult(todayData);\n option.xAxis[0].data = xAxisData;\n option.xAxis[1].data = xAxisData;\n myChart.setOption(option);\n myChart.resize();\n }).catch(function (err) {\n console.log(err)\n });\n}\n\nfunction resize() {\n var currentParent = currentDiv.parentElement;\n currentDiv.style.width = currentParent.clientWidth + 'px';\n currentDiv.style.height = currentParent.clientHeight + 'px';\n}\n\nfunction generatorX() {\n var timeX = [];\n //起点为00:00每五分钟一个点,终点为23:59\n var i = -1;\n while (i++ < pointLen - 1) {\n var current = interval * i\n var hour = Math.floor(interval * i / 60) + \"\"\n var minute = interval * i % 60 + \"\"\n if (hour.length < 2) {\n hour = \"0\" + hour\n }\n if (minute.length < 2) {\n minute = \"0\" + minute\n }\n timeX[i] = hour + \":\" + minute\n }\n xAxisData = timeX;\n}\n\nfunction fillingWithZero(value) {\n return value + \"000000\";\n}\n\nfunction isNull(value) {\n return value == null || value == undefined;\n}\n\nfunction dealResult(data) {\n var i = 0;\n var result = [];\n while (i++ < pointLen) {\n if (isNull(data[i]) || data[i].length <= 1) {\n result[i] = \"0\";\n } else {\n result[i] = data[i][1];\n }\n }\n return result;\n}\nfunction generatorTodayQuery(){\n return \"select count(traceId) from trace_info where path = '\" + path + \"' and time >= \" + fillingWithZero(todayZero)\n + \" and time <= \" + fillingWithZero(Date.now())\n + \" group by time(\" + interval + \"m) fill(0);\";\n}\n</script>\n",
"description": "每5分钟取一个点",
"gridPos": {
"h": 11,
"w": 24,
"x": 0,
"y": 10
},
"id": 12,
"links": [],
"mode": "html",
"title": "访问量同比",
"type": "text"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"fill": 5,
"gridPos": {
"h": 6,
"w": 8,
"x": 0,
"y": 21
},
"id": 4,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "最高用时",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "max"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
},
{
"condition": "AND",
"key": "path",
"operator": "=~",
"value": "/^$path$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "最大耗时",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "ms",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"fill": 5,
"gridPos": {
"h": 6,
"w": 9,
"x": 8,
"y": 21
},
"id": 5,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "中位数",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"refId": "C",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "median"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
},
{
"condition": "AND",
"key": "path",
"operator": "=~",
"value": "/^$path$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "中位数耗时",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "ms",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"fill": 5,
"gridPos": {
"h": 6,
"w": 7,
"x": 17,
"y": 21
},
"id": 6,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "平均耗时",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
},
{
"condition": "AND",
"key": "path",
"operator": "=~",
"value": "/^$path$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "平均耗时",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "ms",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"columns": [],
"fontSize": "100%",
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 27
},
"id": 8,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 1,
"desc": true
},
"styles": [
{
"alias": "kibana追踪",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": true,
"linkTargetBlank": true,
"linkTooltip": "点击进入kibana查看",
"linkUrl": "http://k01.staff.quantgroups.com/s/kdsp/app/kibana#/discover?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-15d,to:now))&_a=(columns:!(_source),interval:auto,query:(language:lucene,query:%22${__cell}%22),sort:!(logtime,desc))",
"mappingType": 1,
"pattern": "traceId",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "请求时间",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Time",
"thresholds": [],
"type": "date",
"unit": "short"
},
{
"alias": "耗时",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "top",
"thresholds": [],
"type": "number",
"unit": "ms"
},
{
"alias": "zipkin追踪(推荐)",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": true,
"linkTargetBlank": true,
"linkTooltip": "点击进入zipkin追踪(可查看最近3天数据)",
"linkUrl": "http://zipkin-3c.xyqb.com/zipkin/traces/${__cell}",
"mappingType": 1,
"pattern": "traceId_1",
"thresholds": [],
"type": "string",
"unit": "short"
}
],
"targets": [
{
"groupBy": [
{
"params": [
"24h"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT top(\"duration\", 10), \"traceId\" FROM \"autogen\".\"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/ AND \"path\" =~ /^$path$/) AND $timeFilter GROUP BY time(24h) fill(0)",
"rawQuery": false,
"refId": "A",
"resultFormat": "table",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [
"200"
],
"type": "top"
}
],
[
{
"params": [
"traceId"
],
"type": "field"
}
],
[
{
"params": [
"traceId"
],
"type": "field"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
},
{
"condition": "AND",
"key": "path",
"operator": "=~",
"value": "/^$path$/"
}
]
}
],
"title": "耗时排名",
"transform": "table",
"type": "table"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 1,
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 35
},
"id": 10,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT derivative(mean(\"duration\"), 5m) FROM \"autogen\".\"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/ AND \"path\" =~ /^$path$/) AND $timeFilter GROUP BY time(5m) fill(0)",
"rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1m"
],
"type": "derivative"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
},
{
"condition": "AND",
"key": "path",
"operator": "=~",
"value": "/^$path$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "耗时变化率",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "5m",
"schemaVersion": 16,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "post /innerapi/user_detail/search/userid",
"value": "post /innerapi/user_detail/search/userid"
},
"hide": 2,
"label": "路由",
"name": "path",
"options": [
{
"selected": false,
"text": "post /ex/xygj/api/submitbasedata",
"value": "post /ex/xygj/api/submitbasedata"
}
],
"query": "get /api/kdsp/activity/activity-goods/special/list-ge-now",
"skipUrlSync": false,
"type": "textbox"
},
{
"current": {
"selected": true,
"text": "xyqb-user2",
"value": "xyqb-user2"
},
"hide": 2,
"label": null,
"name": "sysName",
"options": [
{
"selected": false,
"text": "xyqb-user2",
"value": "xyqb-user2"
}
],
"query": "kdsp-operation",
"skipUrlSync": false,
"type": "textbox"
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "接口详情",
"uid": "gPgQhUXiz",
"version": 66
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 6,
"iteration": 1653464733973,
"links": [],
"panels": [
{
"content": "<div style=\"text-align: center;\">\n<h1><span><span style=\"color:#1C86EE\">$sysName</span>系统已运行<span><span id= \"day\" style=\"color:#00CD00\"></span><span id=\"hour\" style=\"color:#00CD00\"></span><span id=\"minute\" style=\"color:#00CD00\"></span><span id=\"second\" style=\"color:#00CD00\"></span></h1>\n</div>\n<span id='upTimeSpan' style=\"display:none;\">$upTime</span>\n\n\n<script type=\"text/javascript\">\nvar time = parseInt(document.getElementById(\"upTimeSpan\").innerHTML)\nvar day = Math.floor(time/86400)\nvar hour = Math.floor(time/3600)%24\nvar minute = Math.floor(time/60)%60\nvar second = time%60\nif(day > 0){\n document.getElementById(\"day\").innerHTML = day + \"\"\n }\nif(hour > 0){\n document.getElementById(\"hour\").innerHTML = hour + \"小时\"\n}\nif(minute > 0){\n document.getElementById(\"minute\").innerHTML = minute + \"分钟\"\n}\nif(second > 0){\n document.getElementById(\"second\").innerHTML = second + \"\"\n}\n\n</script>",
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 0
},
"id": 18,
"links": [],
"mode": "html",
"title": "",
"type": "text"
},
{
"colors": [
"rgba(50, 172, 45, 0.97)",
"#e5ac0e",
"#bf1b00"
],
"decimals": 2,
"description": "cpu每个核心负载率:总负载/cpu核数",
"fontSizes": [
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
22,
24,
26,
28,
30,
32,
34,
36,
38,
40,
42,
44,
46,
48,
50,
52,
54,
56,
58,
60,
62,
64,
66,
68,
70
],
"fontTypes": [
"Arial",
"Avant Garde",
"Bookman",
"Consolas",
"Courier",
"Courier New",
"Garamond",
"Helvetica",
"Open Sans",
"Palatino",
"Times",
"Times New Roman",
"Verdana"
],
"format": "percent",
"gauge": {
"animateNeedleValueTransition": false,
"animateNeedleValueTransitionSpeed": 100,
"edgeWidth": 0.05,
"gaugeRadius": 120,
"gaugeUnits": "",
"innerCol": "rgb(6, 0, 0)",
"labelFontSize": 18,
"maxNeedleAngle": 320,
"maxTickAngle": 300,
"maxValue": 200,
"minValue": 0,
"needleCol": "#e0f9d7",
"needleLengthNeg": 0.2,
"needleTickGap": 0.05,
"needleWidth": 5,
"outerEdgeCol": "rgb(1, 5, 6)",
"padding": 0.01,
"pivotCol": "#447ebc",
"pivotRadius": 0.1,
"show": true,
"showLowerThresholdRange": true,
"showMiddleThresholdRange": true,
"showThresholdColorOnBackground": false,
"showThresholdColorOnValue": false,
"showThresholdOnGauge": true,
"showUpperThresholdRange": true,
"tickColMaj": "#e0f9d7",
"tickColMin": "#f9e2d2",
"tickEdgeGap": 0.05,
"tickFont": "Courier",
"tickLabelCol": "#f9934e",
"tickLengthMaj": 0.15,
"tickLengthMin": 0.05,
"tickSpaceMajVal": 20,
"tickSpaceMinVal": 1,
"tickWidthMaj": 5,
"tickWidthMin": 1,
"ticknessGaugeBasis": 200,
"unitsFont": "Garamond",
"unitsLabelCol": "#bf1b00",
"unitsLabelFontSize": 22,
"valueYOffset": null,
"zeroNeedleAngle": 40,
"zeroTickAngle": 60
},
"gaugeDivId": "d3gauge_svg_8",
"gridPos": {
"h": 10,
"w": 6,
"x": 0,
"y": 2
},
"id": 8,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"operatorName": "current",
"operatorNameOptions": [
"min",
"max",
"avg",
"current",
"total",
"name"
],
"rangeMaps": [
{
"from": "100",
"text": "dd",
"to": "200"
}
],
"svgContainer": {},
"targets": [
{
"alias": "",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT \"system_load_average\"/\"processors\" * 100 FROM \"machine_info\" WHERE \"host\" =~ /^$host$/ order by time desc limit 1",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"system_load_average"
],
"type": "field"
}
],
[
{
"params": [
"processors"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": "100,150",
"tickMaps": [],
"title": "cpu使用率",
"type": "briangann-gauge-panel",
"unitFormats": [
{
"submenu": [
{
"click": "menuItemSelected(0,0)",
"text": "none",
"value": "none"
},
{
"click": "menuItemSelected(0,1)",
"text": "short",
"value": "short"
},
{
"click": "menuItemSelected(0,2)",
"text": "percent (0-100)",
"value": "percent"
},
{
"click": "menuItemSelected(0,3)",
"text": "percent (0.0-1.0)",
"value": "percentunit"
},
{
"click": "menuItemSelected(0,4)",
"text": "Humidity (%H)",
"value": "humidity"
},
{
"click": "menuItemSelected(0,5)",
"text": "decibel",
"value": "dB"
},
{
"click": "menuItemSelected(0,6)",
"text": "hexadecimal (0x)",
"value": "hex0x"
},
{
"click": "menuItemSelected(0,7)",
"text": "hexadecimal",
"value": "hex"
},
{
"click": "menuItemSelected(0,8)",
"text": "scientific notation",
"value": "sci"
},
{
"click": "menuItemSelected(0,9)",
"text": "locale format",
"value": "locale"
}
],
"text": "none"
},
{
"submenu": [
{
"click": "menuItemSelected(1,0)",
"text": "Dollars ($)",
"value": "currencyUSD"
},
{
"click": "menuItemSelected(1,1)",
"text": "Pounds (£)",
"value": "currencyGBP"
},
{
"click": "menuItemSelected(1,2)",
"text": "Euro (€)",
"value": "currencyEUR"
},
{
"click": "menuItemSelected(1,3)",
"text": "Yen (¥)",
"value": "currencyJPY"
},
{
"click": "menuItemSelected(1,4)",
"text": "Rubles (₽)",
"value": "currencyRUB"
},
{
"click": "menuItemSelected(1,5)",
"text": "Hryvnias (₴)",
"value": "currencyUAH"
},
{
"click": "menuItemSelected(1,6)",
"text": "Real (R$)",
"value": "currencyBRL"
},
{
"click": "menuItemSelected(1,7)",
"text": "Danish Krone (kr)",
"value": "currencyDKK"
},
{
"click": "menuItemSelected(1,8)",
"text": "Icelandic Króna (kr)",
"value": "currencyISK"
},
{
"click": "menuItemSelected(1,9)",
"text": "Norwegian Krone (kr)",
"value": "currencyNOK"
},
{
"click": "menuItemSelected(1,10)",
"text": "Swedish Krona (kr)",
"value": "currencySEK"
},
{
"click": "menuItemSelected(1,11)",
"text": "Czech koruna (czk)",
"value": "currencyCZK"
},
{
"click": "menuItemSelected(1,12)",
"text": "Swiss franc (CHF)",
"value": "currencyCHF"
},
{
"click": "menuItemSelected(1,13)",
"text": "Polish Złoty (PLN)",
"value": "currencyPLN"
},
{
"click": "menuItemSelected(1,14)",
"text": "Bitcoin (฿)",
"value": "currencyBTC"
}
],
"text": "currency"
},
{
"submenu": [
{
"click": "menuItemSelected(2,0)",
"text": "Hertz (1/s)",
"value": "hertz"
},
{
"click": "menuItemSelected(2,1)",
"text": "nanoseconds (ns)",
"value": "ns"
},
{
"click": "menuItemSelected(2,2)",
"text": "microseconds (µs)",
"value": "µs"
},
{
"click": "menuItemSelected(2,3)",
"text": "milliseconds (ms)",
"value": "ms"
},
{
"click": "menuItemSelected(2,4)",
"text": "seconds (s)",
"value": "s"
},
{
"click": "menuItemSelected(2,5)",
"text": "minutes (m)",
"value": "m"
},
{
"click": "menuItemSelected(2,6)",
"text": "hours (h)",
"value": "h"
},
{
"click": "menuItemSelected(2,7)",
"text": "days (d)",
"value": "d"
},
{
"click": "menuItemSelected(2,8)",
"text": "duration (ms)",
"value": "dtdurationms"
},
{
"click": "menuItemSelected(2,9)",
"text": "duration (s)",
"value": "dtdurations"
},
{
"click": "menuItemSelected(2,10)",
"text": "duration (hh:mm:ss)",
"value": "dthms"
},
{
"click": "menuItemSelected(2,11)",
"text": "Timeticks (s/100)",
"value": "timeticks"
},
{
"click": "menuItemSelected(2,12)",
"text": "clock (ms)",
"value": "clockms"
},
{
"click": "menuItemSelected(2,13)",
"text": "clock (s)",
"value": "clocks"
}
],
"text": "time"
},
{
"submenu": [
{
"click": "menuItemSelected(3,0)",
"text": "YYYY-MM-DD HH:mm:ss",
"value": "dateTimeAsIso"
},
{
"click": "menuItemSelected(3,1)",
"text": "DD/MM/YYYY h:mm:ss a",
"value": "dateTimeAsUS"
},
{
"click": "menuItemSelected(3,2)",
"text": "From Now",
"value": "dateTimeFromNow"
}
],
"text": "date & time"
},
{
"submenu": [
{
"click": "menuItemSelected(4,0)",
"text": "bits",
"value": "bits"
},
{
"click": "menuItemSelected(4,1)",
"text": "bytes",
"value": "bytes"
},
{
"click": "menuItemSelected(4,2)",
"text": "kibibytes",
"value": "kbytes"
},
{
"click": "menuItemSelected(4,3)",
"text": "mebibytes",
"value": "mbytes"
},
{
"click": "menuItemSelected(4,4)",
"text": "gibibytes",
"value": "gbytes"
}
],
"text": "data (IEC)"
},
{
"submenu": [
{
"click": "menuItemSelected(5,0)",
"text": "bits",
"value": "decbits"
},
{
"click": "menuItemSelected(5,1)",
"text": "bytes",
"value": "decbytes"
},
{
"click": "menuItemSelected(5,2)",
"text": "kilobytes",
"value": "deckbytes"
},
{
"click": "menuItemSelected(5,3)",
"text": "megabytes",
"value": "decmbytes"
},
{
"click": "menuItemSelected(5,4)",
"text": "gigabytes",
"value": "decgbytes"
}
],
"text": "data (Metric)"
},
{
"submenu": [
{
"click": "menuItemSelected(6,0)",
"text": "packets/sec",
"value": "pps"
},
{
"click": "menuItemSelected(6,1)",
"text": "bits/sec",
"value": "bps"
},
{
"click": "menuItemSelected(6,2)",
"text": "bytes/sec",
"value": "Bps"
},
{
"click": "menuItemSelected(6,3)",
"text": "kilobits/sec",
"value": "Kbits"
},
{
"click": "menuItemSelected(6,4)",
"text": "kilobytes/sec",
"value": "KBs"
},
{
"click": "menuItemSelected(6,5)",
"text": "megabits/sec",
"value": "Mbits"
},
{
"click": "menuItemSelected(6,6)",
"text": "megabytes/sec",
"value": "MBs"
},
{
"click": "menuItemSelected(6,7)",
"text": "gigabytes/sec",
"value": "GBs"
},
{
"click": "menuItemSelected(6,8)",
"text": "gigabits/sec",
"value": "Gbits"
}
],
"text": "data rate"
},
{
"submenu": [
{
"click": "menuItemSelected(7,0)",
"text": "hashes/sec",
"value": "Hs"
},
{
"click": "menuItemSelected(7,1)",
"text": "kilohashes/sec",
"value": "KHs"
},
{
"click": "menuItemSelected(7,2)",
"text": "megahashes/sec",
"value": "MHs"
},
{
"click": "menuItemSelected(7,3)",
"text": "gigahashes/sec",
"value": "GHs"
},
{
"click": "menuItemSelected(7,4)",
"text": "terahashes/sec",
"value": "THs"
},
{
"click": "menuItemSelected(7,5)",
"text": "petahashes/sec",
"value": "PHs"
},
{
"click": "menuItemSelected(7,6)",
"text": "exahashes/sec",
"value": "EHs"
}
],
"text": "hash rate"
},
{
"submenu": [
{
"click": "menuItemSelected(8,0)",
"text": "ops/sec (ops)",
"value": "ops"
},
{
"click": "menuItemSelected(8,1)",
"text": "requests/sec (rps)",
"value": "reqps"
},
{
"click": "menuItemSelected(8,2)",
"text": "reads/sec (rps)",
"value": "rps"
},
{
"click": "menuItemSelected(8,3)",
"text": "writes/sec (wps)",
"value": "wps"
},
{
"click": "menuItemSelected(8,4)",
"text": "I/O ops/sec (iops)",
"value": "iops"
},
{
"click": "menuItemSelected(8,5)",
"text": "ops/min (opm)",
"value": "opm"
},
{
"click": "menuItemSelected(8,6)",
"text": "reads/min (rpm)",
"value": "rpm"
},
{
"click": "menuItemSelected(8,7)",
"text": "writes/min (wpm)",
"value": "wpm"
}
],
"text": "throughput"
},
{
"submenu": [
{
"click": "menuItemSelected(9,0)",
"text": "millimetre (mm)",
"value": "lengthmm"
},
{
"click": "menuItemSelected(9,1)",
"text": "meter (m)",
"value": "lengthm"
},
{
"click": "menuItemSelected(9,2)",
"text": "feet (ft)",
"value": "lengthft"
},
{
"click": "menuItemSelected(9,3)",
"text": "kilometer (km)",
"value": "lengthkm"
},
{
"click": "menuItemSelected(9,4)",
"text": "mile (mi)",
"value": "lengthmi"
}
],
"text": "length"
},
{
"submenu": [
{
"click": "menuItemSelected(10,0)",
"text": "Square Meters (m²)",
"value": "areaM2"
},
{
"click": "menuItemSelected(10,1)",
"text": "Square Feet (ft²)",
"value": "areaF2"
},
{
"click": "menuItemSelected(10,2)",
"text": "Square Miles (mi²)",
"value": "areaMI2"
}
],
"text": "area"
},
{
"submenu": [
{
"click": "menuItemSelected(11,0)",
"text": "milligram (mg)",
"value": "massmg"
},
{
"click": "menuItemSelected(11,1)",
"text": "gram (g)",
"value": "massg"
},
{
"click": "menuItemSelected(11,2)",
"text": "kilogram (kg)",
"value": "masskg"
},
{
"click": "menuItemSelected(11,3)",
"text": "metric ton (t)",
"value": "masst"
}
],
"text": "mass"
},
{
"submenu": [
{
"click": "menuItemSelected(12,0)",
"text": "metres/second (m/s)",
"value": "velocityms"
},
{
"click": "menuItemSelected(12,1)",
"text": "kilometers/hour (km/h)",
"value": "velocitykmh"
},
{
"click": "menuItemSelected(12,2)",
"text": "miles/hour (mph)",
"value": "velocitymph"
},
{
"click": "menuItemSelected(12,3)",
"text": "knot (kn)",
"value": "velocityknot"
}
],
"text": "velocity"
},
{
"submenu": [
{
"click": "menuItemSelected(13,0)",
"text": "millilitre (mL)",
"value": "mlitre"
},
{
"click": "menuItemSelected(13,1)",
"text": "litre (L)",
"value": "litre"
},
{
"click": "menuItemSelected(13,2)",
"text": "cubic metre",
"value": "m3"
},
{
"click": "menuItemSelected(13,3)",
"text": "Normal cubic metre",
"value": "Nm3"
},
{
"click": "menuItemSelected(13,4)",
"text": "cubic decimetre",
"value": "dm3"
},
{
"click": "menuItemSelected(13,5)",
"text": "gallons",
"value": "gallons"
}
],
"text": "volume"
},
{
"submenu": [
{
"click": "menuItemSelected(14,0)",
"text": "Watt (W)",
"value": "watt"
},
{
"click": "menuItemSelected(14,1)",
"text": "Kilowatt (kW)",
"value": "kwatt"
},
{
"click": "menuItemSelected(14,2)",
"text": "Milliwatt (mW)",
"value": "mwatt"
},
{
"click": "menuItemSelected(14,3)",
"text": "Watt per square metre (W/m²)",
"value": "Wm2"
},
{
"click": "menuItemSelected(14,4)",
"text": "Volt-ampere (VA)",
"value": "voltamp"
},
{
"click": "menuItemSelected(14,5)",
"text": "Kilovolt-ampere (kVA)",
"value": "kvoltamp"
},
{
"click": "menuItemSelected(14,6)",
"text": "Volt-ampere reactive (var)",
"value": "voltampreact"
},
{
"click": "menuItemSelected(14,7)",
"text": "Kilovolt-ampere reactive (kvar)",
"value": "kvoltampreact"
},
{
"click": "menuItemSelected(14,8)",
"text": "Watt-hour (Wh)",
"value": "watth"
},
{
"click": "menuItemSelected(14,9)",
"text": "Kilowatt-hour (kWh)",
"value": "kwatth"
},
{
"click": "menuItemSelected(14,10)",
"text": "Kilowatt-min (kWm)",
"value": "kwattm"
},
{
"click": "menuItemSelected(14,11)",
"text": "Joule (J)",
"value": "joule"
},
{
"click": "menuItemSelected(14,12)",
"text": "Electron volt (eV)",
"value": "ev"
},
{
"click": "menuItemSelected(14,13)",
"text": "Ampere (A)",
"value": "amp"
},
{
"click": "menuItemSelected(14,14)",
"text": "Kiloampere (kA)",
"value": "kamp"
},
{
"click": "menuItemSelected(14,15)",
"text": "Milliampere (mA)",
"value": "mamp"
},
{
"click": "menuItemSelected(14,16)",
"text": "Volt (V)",
"value": "volt"
},
{
"click": "menuItemSelected(14,17)",
"text": "Kilovolt (kV)",
"value": "kvolt"
},
{
"click": "menuItemSelected(14,18)",
"text": "Millivolt (mV)",
"value": "mvolt"
},
{
"click": "menuItemSelected(14,19)",
"text": "Decibel-milliwatt (dBm)",
"value": "dBm"
},
{
"click": "menuItemSelected(14,20)",
"text": "Ohm (Ω)",
"value": "ohm"
},
{
"click": "menuItemSelected(14,21)",
"text": "Lumens (Lm)",
"value": "lumens"
}
],
"text": "energy"
},
{
"submenu": [
{
"click": "menuItemSelected(15,0)",
"text": "Celsius (°C)",
"value": "celsius"
},
{
"click": "menuItemSelected(15,1)",
"text": "Farenheit (°F)",
"value": "farenheit"
},
{
"click": "menuItemSelected(15,2)",
"text": "Kelvin (K)",
"value": "kelvin"
}
],
"text": "temperature"
},
{
"submenu": [
{
"click": "menuItemSelected(16,0)",
"text": "Millibars",
"value": "pressurembar"
},
{
"click": "menuItemSelected(16,1)",
"text": "Bars",
"value": "pressurebar"
},
{
"click": "menuItemSelected(16,2)",
"text": "Kilobars",
"value": "pressurekbar"
},
{
"click": "menuItemSelected(16,3)",
"text": "Hectopascals",
"value": "pressurehpa"
},
{
"click": "menuItemSelected(16,4)",
"text": "Kilopascals",
"value": "pressurekpa"
},
{
"click": "menuItemSelected(16,5)",
"text": "Inches of mercury",
"value": "pressurehg"
},
{
"click": "menuItemSelected(16,6)",
"text": "PSI",
"value": "pressurepsi"
}
],
"text": "pressure"
},
{
"submenu": [
{
"click": "menuItemSelected(17,0)",
"text": "Newton-meters (Nm)",
"value": "forceNm"
},
{
"click": "menuItemSelected(17,1)",
"text": "Kilonewton-meters (kNm)",
"value": "forcekNm"
},
{
"click": "menuItemSelected(17,2)",
"text": "Newtons (N)",
"value": "forceN"
},
{
"click": "menuItemSelected(17,3)",
"text": "Kilonewtons (kN)",
"value": "forcekN"
}
],
"text": "force"
},
{
"submenu": [
{
"click": "menuItemSelected(18,0)",
"text": "Gallons/min (gpm)",
"value": "flowgpm"
},
{
"click": "menuItemSelected(18,1)",
"text": "Cubic meters/sec (cms)",
"value": "flowcms"
},
{
"click": "menuItemSelected(18,2)",
"text": "Cubic feet/sec (cfs)",
"value": "flowcfs"
},
{
"click": "menuItemSelected(18,3)",
"text": "Cubic feet/min (cfm)",
"value": "flowcfm"
},
{
"click": "menuItemSelected(18,4)",
"text": "Litre/hour",
"value": "litreh"
},
{
"click": "menuItemSelected(18,5)",
"text": "Litre/min (l/min)",
"value": "flowlpm"
},
{
"click": "menuItemSelected(18,6)",
"text": "milliLitre/min (mL/min)",
"value": "flowmlpm"
}
],
"text": "flow"
},
{
"submenu": [
{
"click": "menuItemSelected(19,0)",
"text": "Degrees (°)",
"value": "degree"
},
{
"click": "menuItemSelected(19,1)",
"text": "Radians",
"value": "radian"
},
{
"click": "menuItemSelected(19,2)",
"text": "Gradian",
"value": "grad"
}
],
"text": "angle"
},
{
"submenu": [
{
"click": "menuItemSelected(20,0)",
"text": "Meters/sec²",
"value": "accMS2"
},
{
"click": "menuItemSelected(20,1)",
"text": "Feet/sec²",
"value": "accFS2"
},
{
"click": "menuItemSelected(20,2)",
"text": "G unit",
"value": "accG"
}
],
"text": "acceleration"
},
{
"submenu": [
{
"click": "menuItemSelected(21,0)",
"text": "Becquerel (Bq)",
"value": "radbq"
},
{
"click": "menuItemSelected(21,1)",
"text": "curie (Ci)",
"value": "radci"
},
{
"click": "menuItemSelected(21,2)",
"text": "Gray (Gy)",
"value": "radgy"
},
{
"click": "menuItemSelected(21,3)",
"text": "rad",
"value": "radrad"
},
{
"click": "menuItemSelected(21,4)",
"text": "Sievert (Sv)",
"value": "radsv"
},
{
"click": "menuItemSelected(21,5)",
"text": "rem",
"value": "radrem"
},
{
"click": "menuItemSelected(21,6)",
"text": "Exposure (C/kg)",
"value": "radexpckg"
},
{
"click": "menuItemSelected(21,7)",
"text": "roentgen (R)",
"value": "radr"
},
{
"click": "menuItemSelected(21,8)",
"text": "Sievert/hour (Sv/h)",
"value": "radsvh"
}
],
"text": "radiation"
},
{
"submenu": [
{
"click": "menuItemSelected(22,0)",
"text": "parts-per-million (ppm)",
"value": "ppm"
},
{
"click": "menuItemSelected(22,1)",
"text": "parts-per-billion (ppb)",
"value": "conppb"
},
{
"click": "menuItemSelected(22,2)",
"text": "nanogram per cubic metre (ng/m³)",
"value": "conngm3"
},
{
"click": "menuItemSelected(22,3)",
"text": "nanogram per normal cubic metre (ng/Nm³)",
"value": "conngNm3"
},
{
"click": "menuItemSelected(22,4)",
"text": "microgram per cubic metre (μg/m³)",
"value": "conμgm3"
},
{
"click": "menuItemSelected(22,5)",
"text": "microgram per normal cubic metre (μg/Nm³)",
"value": "conμgNm3"
},
{
"click": "menuItemSelected(22,6)",
"text": "milligram per cubic metre (mg/m³)",
"value": "conmgm3"
},
{
"click": "menuItemSelected(22,7)",
"text": "milligram per normal cubic metre (mg/Nm³)",
"value": "conmgNm3"
},
{
"click": "menuItemSelected(22,8)",
"text": "gram per cubic metre (g/m³)",
"value": "congm3"
},
{
"click": "menuItemSelected(22,9)",
"text": "gram per normal cubic metre (g/Nm³)",
"value": "congNm3"
}
],
"text": "concentration"
}
],
"valueMaps": []
},
{
"aliasColors": {},
"breakPoint": "50%",
"cacheTimeout": null,
"combine": {
"label": "Others",
"threshold": ""
},
"fontSize": "100%",
"format": "decbytes",
"gridPos": {
"h": 10,
"w": 6,
"x": 6,
"y": 2
},
"id": 6,
"interval": null,
"legend": {
"percentage": false,
"show": true,
"values": true
},
"legendType": "On graph",
"links": [],
"maxDataPoints": 3,
"nullPointMode": "connected",
"pieType": "pie",
"strokeWidth": "2",
"targets": [
{
"alias": "$col",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT \"disk_tol\" - \"disk_free\" as used, \"disk_free\" FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) order by time desc limit 1",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"disk_tol"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"title": "硬盘使用量",
"type": "grafana-piechart-panel",
"valueName": "current"
},
{
"aliasColors": {
"machine_info.free": "#508642",
"machine_info.used": "#f2c96d"
},
"breakPoint": "50%",
"cacheTimeout": null,
"combine": {
"label": "Others",
"threshold": 0
},
"fontSize": "80%",
"format": "deckbytes",
"gridPos": {
"h": 10,
"w": 6,
"x": 12,
"y": 2
},
"id": 4,
"interval": null,
"legend": {
"percentage": false,
"show": true,
"sortDesc": true,
"values": true
},
"legendType": "On graph",
"links": [],
"maxDataPoints": 3,
"nullPointMode": "connected",
"pieType": "pie",
"strokeWidth": 1,
"targets": [
{
"alias": "$col",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (\"mem_tol\" - \"mem_free\") as used, \"mem_free\" as free FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) order by time desc limit 1",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mem_tol"
],
"type": "field"
}
],
[
{
"params": [
"mem_free"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"title": "内存使用量",
"type": "grafana-piechart-panel",
"valueName": "current"
},
{
"aliasColors": {},
"breakPoint": "50%",
"cacheTimeout": null,
"combine": {
"label": "Others",
"threshold": 0
},
"fontSize": "100%",
"format": "short",
"gridPos": {
"h": 10,
"w": 6,
"x": 18,
"y": 2
},
"id": 16,
"interval": null,
"legend": {
"show": true,
"values": true
},
"legendType": "On graph",
"links": [],
"maxDataPoints": 3,
"nullPointMode": "connected",
"pieType": "pie",
"strokeWidth": 1,
"targets": [
{
"alias": "$col",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT class_loaded as loaded, class_unloaded as unloaded FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) order by time desc limit 1",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"title": "类加载数量",
"type": "grafana-piechart-panel",
"valueName": "current"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"description": "cpu实际总负载",
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 12
},
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT last(\"system_load_average\")/last(processors) FROM \"autogen\".\"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time($interval)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"system_load_average"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CPU负载",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": null,
"format": "percentunit",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 4,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 12
},
"id": 10,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$col",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"mem_tol\") as tol, (last(mem_tol) - last(mem_free)) as used FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time($__interval)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mem_tol"
],
"type": "field"
}
],
[
{
"params": [
"mem_free"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "内存",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "deckbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 21
},
"id": 14,
"legend": {
"avg": false,
"current": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "total",
"lines": false,
"yaxis": 2
},
{
"alias": "init",
"lines": false,
"yaxis": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$col",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(nonheap_commit) as commit, last(nonheap_used) as used, last(nonheap_init) as init, last(nonheap_tol) as total FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time($__interval) ",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "非堆内存",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "deckbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "deckbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"init": "#f9934e",
"tol": "#3f6833"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 3,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 21
},
"id": 12,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$col",
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(heap_tol) as tol, last(heap_init) as init, last(heap_used) as used FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time($__interval)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"heap_tol"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "堆内存",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "deckbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"columns": [],
"fontSize": "100%",
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 30
},
"id": 24,
"links": [],
"pageSize": null,
"scroll": false,
"showHeader": true,
"sort": {
"col": 2,
"desc": true
},
"styles": [
{
"alias": "Time",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"link": false,
"pattern": "Time",
"type": "hidden"
},
{
"alias": "总耗时(ms)",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "总耗时",
"thresholds": [],
"type": "string",
"unit": "none"
},
{
"alias": "平均耗时(ms)",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "平均耗时",
"thresholds": [],
"type": "number",
"unit": "none"
},
{
"alias": "GC类型",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "类型",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short",
"valueMaps": [
{
"text": "CMS",
"value": "-1"
},
{
"text": "parNew",
"value": "-3"
}
]
}
],
"targets": [
{
"groupBy": [],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT \"类型\" , \"gc_parnew_count\" as \"GC次数\", \"gc_parnew_time\" as \"总耗时\", gc_parnew_time/gc_parnew_count as \"平均耗时\"FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) fill(-3) order by time desc limit 1",
"rawQuery": true,
"refId": "A",
"resultFormat": "table",
"select": [
[
{
"params": [
"gc_parnew_count"
],
"type": "field"
}
],
[
{
"params": [
"gc_parnew_time"
],
"type": "field"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
},
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT \"类型\" , \"gc_concurrent_mark_sweep\" as \"GC次数\", \"gc_concurrent_mark_time\" as \"总耗时\", gc_concurrent_mark_time/gc_concurrent_mark_sweep as \"平均耗时\" FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) fill(-1) order by time desc limit 1",
"rawQuery": true,
"refId": "B",
"resultFormat": "table",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"title": "GC统计",
"transform": "table",
"type": "table"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"fill": 1,
"gridPos": {
"h": 5,
"w": 12,
"x": 12,
"y": 30
},
"id": 28,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 6,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"repeatDirection": "h",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"orderByTime": "ASC",
"policy": "default",
"query": "select median(class_loaded) as \"class_loaded\",median(class_tol) as \"class_tol\",median(class_unloaded) as \"class_unloaded\" from machine_info where $timeFilter and (\"host\" =~ /^$host$/) group by time($__interval) ",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "类加载数量",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": null,
"format": "locale",
"label": " 类数量",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 35
},
"id": 20,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "创建线程总数",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"thread_tol\") FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time($interval)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"thread_tol"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "线程创建总数",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 8,
"x": 12,
"y": 35
},
"id": 22,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$col",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"thread_peak\") as peak, last(\"thread_daemon\") as daemon FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time($interval)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"thread_peak"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
],
[
{
"params": [
"thread_daemon"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "当前线程状态",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"content": "<span id= \"host\" style=\"display:none;\">$host</span>\n<div id=\"main\">\n<table style=\"border:1px solid\", rules=\"all\" id=\"table\">\n \n</table>\n</div>\n\n<script>\nvar currentDiv = document.getElementById(\"main\");\nvar host = document.getElementById(\"host\").innerHTML\nvar table = document.getElementById(\"table\");\nvar loadDataInterVal = 1000;\n\n\n// 1秒刷新一次\nloadData();\nsetInterval(\"loadData()\", loadDataInterVal);\nvar url = 'http://172.20.6.33:3000/api/datasources/proxy/1/query';\nvar query = \"select * from health_info where host = '\" + host + \"' order by time desc limit 1\";\nfunction loadData() {\n axios.get(url,\n { params: { db: 'monitor', q: query, epoch: 'ms', } })\n .then(function (rs) {\n var series = rs.data.results[0].series;\n var columns = series[0].columns;\n var values = series[0].values[0]\n var len = columns.length;\n var html = '<tr style=\"border:1px solid\"><th>数据源</th><th>状态</th></tr>';\n for(var i = 0; i < len; i++){\n var col = columns[i];\n if(col != \"time\" && col != \"host\" && col != \"sys_name\" && col != \"redis_status\"){\n var value = values[i];\n if(value != null){\n console.log(col);\n var status = (value == 1?'UP': 'DOWN');\n var color = (value == 1? \"green\":\"red\");\n html += \"<tr bgcolor='\" + color + \"'><td>\" + col + \"</td><td>\" + status + \"</td></tr>\";\n }\n }\n }\n table.innerHTML = html;\n\n }).catch(function (err) {\n console.log(err)\n });\n}\n\n</script>\n",
"gridPos": {
"h": 9,
"w": 4,
"x": 20,
"y": 35
},
"id": 26,
"links": [],
"mode": "html",
"title": "数据源状态",
"type": "text"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 44
},
"id": 29,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "ygc",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"gc_parnew_count\")-min(\"gc_parnew_count\") FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time(60s)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"thread_tol"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "parNew-ygc",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 44
},
"id": 31,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "ygc",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (last(\"gc_parnew_time\")-min(\"gc_parnew_time\"))/(last(\"gc_parnew_count\")-min(\"gc_parnew_count\")) FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time(60s)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"thread_tol"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "parNew-ygc-时间",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 53
},
"id": 32,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "CMS",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"gc_concurrent_mark_sweep\")-min(\"gc_concurrent_mark_sweep\") FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time(60s)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"thread_tol"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CMS",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 53
},
"id": 30,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "cms",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"gc_concurrent_mark_time\")-min(\"gc_concurrent_mark_time\") as avg FROM \"machine_info\" WHERE (\"host\" =~ /^$host$/) AND $timeFilter GROUP BY time(60s)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"thread_tol"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CMS-时间",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": false,
"schemaVersion": 16,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"text": "acs-quartz-scheduler",
"value": "acs-quartz-scheduler"
},
"datasource": "InfluxDB",
"definition": "show tag values from trace_info with key = sys_name where sys_name != 'xyqb_user2_query'",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "sysName",
"options": [],
"query": "show tag values from trace_info with key = sys_name where sys_name != 'xyqb_user2_query'",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"isNone": true,
"text": "None",
"value": ""
},
"datasource": "InfluxDB",
"definition": "show tag values from machine_info with key= host where sys_name = '$sysName'",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "host",
"options": [],
"query": "show tag values from machine_info with key= host where sys_name = '$sysName'",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "show tag values from machine_info with key= host where sys_name = $sysName",
"tags": [],
"tagsQuery": "host",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"isNone": true,
"text": "None",
"value": ""
},
"datasource": "InfluxDB",
"definition": "select (uptime/1000) as sec from machine_info where (\"host\" =~ /^$host$/) order by time desc limit 1",
"hide": 2,
"includeAll": false,
"label": null,
"multi": false,
"name": "upTime",
"options": [],
"query": "select (uptime/1000) as sec from machine_info where (\"host\" =~ /^$host$/) order by time desc limit 1",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"1s",
"5s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "nodeDetail",
"uid": "K5bjZvjiz",
"version": 140
}
\ No newline at end of file
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 3,
"iteration": 1653464705484,
"links": [
{
"asDropdown": false,
"icon": "external link",
"includeVars": true,
"keepTime": false,
"tags": [
"xyqb-user2"
],
"targetBlank": true,
"type": "dashboards"
}
],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"decimals": null,
"description": "每分钟的请求数",
"fill": 5,
"gridPos": {
"h": 6,
"w": 12,
"x": 0,
"y": 0
},
"id": 22,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "服务访问量",
"groupBy": [
{
"params": [
"auto"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT count(\"traceId\") FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(1m) fill(0)",
"rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"traceId"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "服务访问量",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": null,
"format": "locale",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 1,
"gridPos": {
"h": 6,
"w": 12,
"x": 12,
"y": 0
},
"id": 20,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$sysName",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (sat +tol)/ct_all FROM \"apdex\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter fill(0)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Apdex",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"172.20.1.126": "#ea6460",
"172.20.1.127": "#7eb26d"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"description": "每台主机的cpu总负载",
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 6
},
"id": 28,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_host",
"groupBy": [
{
"params": [
"host"
],
"type": "tag"
}
],
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT LAST(\"system_load_average\")/last(processors) FROM \"autogen\".\"machine_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY \"host\", time(30s) fill(0)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"system_load_average"
],
"type": "field"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "系统负载",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percentunit",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"description": "内存使用量占比",
"fill": 1,
"gridPos": {
"h": 9,
"w": 9,
"x": 12,
"y": 6
},
"id": 30,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_host",
"groupBy": [
{
"params": [
"host"
],
"type": "tag"
}
],
"hide": false,
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (last(mem_tol)- last(mem_free))/last(mem_tol) * 100 FROM \"machine_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY \"host\", time(30s) fill(0)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mem_free"
],
"type": "field"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "内存负载",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percent",
"label": null,
"logBase": 1,
"max": "100",
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"columns": [],
"description": "主机状态",
"fontSize": "100%",
"gridPos": {
"h": 9,
"w": 3,
"x": 21,
"y": 6
},
"id": 34,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"alias": "主机ip",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": true,
"linkTargetBlank": true,
"linkTooltip": "${__cell}",
"linkUrl": "http://172.20.6.33:3000/d/K5bjZvjiz/nodedetail?orgId=1&var-sysName=$sysName&var-host=${__cell}",
"mappingType": 1,
"pattern": "Metric",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "状态",
"colorMode": "row",
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"#629e51"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 0,
"mappingType": 1,
"pattern": "Value",
"preserveFormat": true,
"rangeMaps": [],
"sanitize": true,
"thresholds": [
"0",
"1"
],
"type": "string",
"unit": "none",
"valueMaps": [
{
"text": "运行",
"value": "1"
},
{
"text": "宕机",
"value": "0"
}
]
},
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Time",
"thresholds": [],
"type": "hidden",
"unit": "short"
}
],
"targets": [
{
"alias": "$tag_host",
"groupBy": [
{
"params": [
"host"
],
"type": "tag"
}
],
"hide": false,
"measurement": "machine_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"sever_status\") FROM \"machine_info\" WHERE (\"sys_name\" =~ /^$sysName$/) GROUP BY \"host\" order by time desc limit 1",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"sever_status"
],
"type": "field"
},
{
"params": [],
"type": "last"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"title": "主机列表",
"transform": "timeseries_to_rows",
"type": "table"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"description": "每分钟请求数",
"fill": 2,
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 15
},
"id": 4,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"hideEmpty": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"sort": null,
"sortDesc": null,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [
{
"type": "dashboard"
}
],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_path",
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"path"
],
"type": "tag"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT count(\"traceId\") AS \"couu\" FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time($__interval), \"path\" fill(null)",
"rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"traceId"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "接口访问量",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "rpm",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"172.30.3.6": "#511749",
"172.30.3.7": "#890f02"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 1,
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 23
},
"id": 24,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"hideEmpty": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": null,
"total": true,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"seriesOverrides": [
{}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_host",
"groupBy": [
{
"params": [
"1m"
],
"type": "time"
},
{
"params": [
"host"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT count(\"traceId\") FROM \"autogen\".\"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(1m), \"host\" fill(0)",
"rawQuery": true,
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"traceId"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "每台机器的服务访问量",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"content": "<span id= \"sysName\" style=\"display:none;\">$sysName</span>\n<div id=\"main\"></div>\n\n<script>\nvar currentDiv = document.getElementById(\"main\");\nvar sysName = document.getElementById(\"sysName\").innerHTML\nvar xAxisData = [];\nvar myChart = echarts.init(currentDiv);\nvar colors = ['#5793f3', '#d14a61', '#675bba'];\nvar option = {\n color: colors,\n title: {\n text: '',\n textStyle: {\n color: \"#FFFFFF\"\n }\n },\n tooltip: {\n trigger: 'none',\n axisPointer: {\n type: 'cross'\n }\n },\n legend: {\n data: ['昨天', '今天'],\n textStyle: {\n color: \"#FFFFFF\"\n }\n },\n grid: {\n top: 70,\n bottom: 50\n },\n textStyle: {\n color: \"#FFFFFF\"\n },\n xAxis: [\n {\n type: 'category',\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n onZero: false,\n lineStyle: {\n color: colors[1]\n }\n },\n axisPointer: {\n label: {\n formatter: function (params) {\n return '访问量: ' + params.value\n + (params.seriesData.length ? ':' + params.seriesData[0].data : '');\n }\n }\n },\n data: xAxisData\n },\n {\n type: 'category',\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n onZero: false,\n lineStyle: {\n color: colors[0]\n }\n },\n axisPointer: {\n label: {\n formatter: function (params) {\n return '访问量: ' + params.value\n + (params.seriesData.length ? ':' + params.seriesData[0].data : '');\n }\n }\n },\n data: xAxisData\n }\n ],\n yAxis: [\n {\n type: 'value',\n min: 'dataMin',\n scale: true\n }\n ],\n series: [\n {\n name: \"昨天\",\n type: 'line',\n xAxisIndex: 1,\n smooth: true\n },\n {\n name: \"今天\",\n type: 'line',\n smooth: true\n }\n ]\n};\n//每5分钟采一个点\nvar interval = 5;\nvar dayOfSecond = 86400;\n//每分钟刷新一次\nvar loadDataInterVal = 60 * 1000;\nvar pointLen = dayOfSecond/interval/60 + 1;\nvar url = 'http://172.20.6.33:3000/api/datasources/proxy/1/query';\nvar params = { db: 'monitor', epoch: 'ms' };\n//毫秒\nvar now = Date.now();\nvar todayZero = new Date(new Date().setHours(0, 0, 0, 0)).getTime();\nvar yesterdayZero = todayZero - 86400000;\nvar yesterdayQuery = \"select count(traceId) from trace_info where sys_name = '\" + sysName + \"' and time >= \" + fillingWithZero(yesterdayZero)\n + \" and time <= \" + fillingWithZero(todayZero - 1)\n + \" group by time(\" + interval + \"m) fill(0);\";\n\n// 5分钟刷新一次\nloadData();\nsetInterval(\"loadData()\", loadDataInterVal);\n\nfunction loadData() {\n axios.get(url,\n { params: { db: 'monitor', q: yesterdayQuery + generatorTodayQuery(), epoch: 'ms', } })\n .then(function (rs) {\n var yesterdayData = rs.data.results[0].series[0].values\n var todayData = rs.data.results[1].series[0].values\n resize();\n generatorX();\n option.series[0].data = dealResult(yesterdayData);\n option.series[1].data = dealResult(todayData);\n option.xAxis[0].data = xAxisData;\n option.xAxis[1].data = xAxisData;\n myChart.setOption(option);\n myChart.resize();\n }).catch(function (err) {\n console.log(err)\n });\n}\n\nfunction resize() {\n var currentParent = currentDiv.parentElement;\n currentDiv.style.width = currentParent.clientWidth + 'px';\n currentDiv.style.height = currentParent.clientHeight + 'px';\n}\n\nfunction generatorX() {\n var timeX = [];\n //起点为00:00每五分钟一个点,终点为23:59\n var i = -1;\n while (i++ < pointLen - 1) {\n var current = interval * i\n var hour = Math.floor(interval * i / 60) + \"\"\n var minute = interval * i % 60 + \"\"\n if (hour.length < 2) {\n hour = \"0\" + hour\n }\n if (minute.length < 2) {\n minute = \"0\" + minute\n }\n timeX[i] = hour + \":\" + minute\n }\n xAxisData = timeX;\n}\n\nfunction fillingWithZero(value) {\n return value + \"000000\";\n}\n\nfunction isNull(value) {\n return value == null || value == undefined;\n}\n\nfunction dealResult(data) {\n var i = 0;\n var result = [];\n while (i++ < pointLen) {\n if (isNull(data[i]) || data[i].length <= 1) {\n result[i] = \"0\";\n } else {\n result[i] = data[i][1];\n }\n }\n return result;\n}\nfunction generatorTodayQuery(){\n return \"select count(traceId) from trace_info where sys_name = '\" + sysName + \"' and time >= \" + fillingWithZero(todayZero)\n + \" and time <= \" + fillingWithZero(Date.now())\n + \" group by time(\" + interval + \"m) fill(0);\";\n}\n</script>\n",
"description": "每5分钟取一个点",
"gridPos": {
"h": 15,
"w": 24,
"x": 0,
"y": 31
},
"id": 36,
"links": [],
"mode": "html",
"title": "访问量同比",
"type": "text"
},
{
"columns": [],
"datasource": "InfluxDB",
"fontSize": "100%",
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 46
},
"id": 18,
"links": [],
"pageSize": null,
"repeat": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": null,
"desc": false
},
"styles": [
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"linkTargetBlank": false,
"mappingType": 1,
"pattern": "Time",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"alias": "请求路径",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": true,
"linkTargetBlank": true,
"linkTooltip": "${__cell}",
"linkUrl": "http://enoch.quantgroups.com/d/gPgQhUXiz/api?orgId=1&refresh=5m&var-sysName=$sysName&var-path=${__cell} ",
"mappingType": 1,
"pattern": "path",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "最大耗时",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"mappingType": 1,
"pattern": "max",
"preserveFormat": false,
"thresholds": [],
"type": "number",
"unit": "ms",
"valueMaps": []
},
{
"alias": "平均耗时",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "mean",
"thresholds": [],
"type": "number",
"unit": "ms"
},
{
"alias": "中位值",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "median",
"thresholds": [],
"type": "number",
"unit": "ms"
},
{
"alias": "请求次数",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 0,
"mappingType": 1,
"pattern": "count",
"thresholds": [],
"type": "number",
"unit": "short"
},
{
"alias": "标准差",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "stddev",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"groupBy": [
{
"params": [
"24h"
],
"type": "time"
},
{
"params": [
"path"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"hide": false,
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT max(\"duration\") FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(24h), \"path\" fill(0) tz('Asia/Shanghai')",
"rawQuery": true,
"refId": "A",
"resultFormat": "table",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "max"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
},
{
"groupBy": [
{
"params": [
"24h"
],
"type": "time"
},
{
"params": [
"path"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"duration\") FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(24h), \"path\" fill(0) tz('Asia/Shanghai')",
"rawQuery": true,
"refId": "B",
"resultFormat": "table",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
},
{
"groupBy": [
{
"params": [
"24h"
],
"type": "time"
},
{
"params": [
"path"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT median(\"duration\") FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(24h), \"path\" fill(0) tz('Asia/Shanghai')",
"rawQuery": true,
"refId": "C",
"resultFormat": "table",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "median"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
},
{
"groupBy": [
{
"params": [
"24h"
],
"type": "time"
},
{
"params": [
"path"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT count(\"traceId\") FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(24h), \"path\" fill(0) tz('Asia/Shanghai')",
"rawQuery": true,
"refId": "D",
"resultFormat": "table",
"select": [
[
{
"params": [
"traceId"
],
"type": "field"
},
{
"params": [],
"type": "count"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
},
{
"groupBy": [
{
"params": [
"24h"
],
"type": "time"
},
{
"params": [
"path"
],
"type": "tag"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "trace_info",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT stddev(\"duration\") FROM \"trace_info\" WHERE (\"sys_name\" =~ /^$sysName$/) AND $timeFilter GROUP BY time(24h), \"path\" fill(0) tz('Asia/Shanghai')",
"rawQuery": true,
"refId": "E",
"resultFormat": "table",
"select": [
[
{
"params": [
"duration"
],
"type": "field"
},
{
"params": [],
"type": "stddev"
}
]
],
"tags": [
{
"key": "sys_name",
"operator": "=~",
"value": "/^$sysName$/"
}
]
}
],
"title": "接口耗时",
"transform": "table",
"transparent": false,
"type": "table"
}
],
"refresh": false,
"schemaVersion": 16,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"text": "kdsp-api",
"value": "kdsp-api"
},
"datasource": "InfluxDB",
"definition": "show tag values from trace_info with key = sys_name where sys_name != 'xyqb_user2_query'",
"hide": 0,
"includeAll": false,
"label": "服务",
"multi": false,
"name": "sysName",
"options": [],
"query": "show tag values from trace_info with key = sys_name where sys_name != 'xyqb_user2_query'",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"auto": true,
"auto_count": 1,
"auto_min": "1m",
"current": {
"text": "1m",
"value": "1m"
},
"hide": 1,
"label": "time interval",
"name": "myInterval",
"options": [
{
"selected": false,
"text": "auto",
"value": "$__auto_interval_myInterval"
},
{
"selected": true,
"text": "1m",
"value": "1m"
},
{
"selected": false,
"text": "5m",
"value": "5m"
},
{
"selected": false,
"text": "10m",
"value": "10m"
},
{
"selected": false,
"text": "30m",
"value": "30m"
},
{
"selected": false,
"text": "1h",
"value": "1h"
},
{
"selected": false,
"text": "6h",
"value": "6h"
},
{
"selected": false,
"text": "12h",
"value": "12h"
},
{
"selected": false,
"text": "1d",
"value": "1d"
},
{
"selected": false,
"text": "7d",
"value": "7d"
},
{
"selected": false,
"text": "14d",
"value": "14d"
},
{
"selected": false,
"text": "30d",
"value": "30d"
}
],
"query": "1m,5m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2,
"skipUrlSync": false,
"type": "interval"
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"nowDelay": "",
"refresh_intervals": [
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "server",
"uid": "Qvs4cB_iz",
"version": 343
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment