Grafana dashboard: 1 Zentao Dashboard 报告图表
Description: 禅道测试报告图表绘制

2020-5-21 
1、适配 grafana 7
2、使用 new table，调整部分样式

基于禅道开源版制作的测试报告图表。

1、需要打开禅道数据库（默认mysql）的只读权限，并将DB配置好；

2、导入模板，左侧列表可以选择项目，所有的数据根据项目自动计算；

3、仅供测试同学使用，产品狗绕行。


2020-5-21 

1、适配 grafana 7；

2、使用 new table，调整部分样式。


有任何问题，欢迎邮件我，一定及时回复，E-mail: henry525@qq.com

{
  "__inputs": [
    {
      "name": "DS_ZENTAO",
      "label": "zentao",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.0.0"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.5.0"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table-old",
      "name": "Table (old)",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 11557,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1590048597986,
  "links": [],
  "panels": [
    {
      "cacheTimeout": null,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              },
              {
                "color": "green",
                "value": 80
              },
              {
                "color": "purple",
                "value": 90
              },
              {
                "color": "red",
                "value": 100
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-orange",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-green",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "bug总数"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-purple",
                      "value": null
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 3,
        "w": 10,
        "x": 0,
        "y": 0
      },
      "id": 49,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "values": false
        }
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as 'bug总数'  FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}';",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "activatedCount"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "activatedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '致命' FROM zt_bug where product=${product_id} and deleted='0' and severity='1' and module not REGEXP '${except_id}';",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '严重' FROM zt_bug where product=${product_id} and deleted='0'and severity='2' and module not REGEXP '${except_id}';",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '一般' FROM zt_bug where product=${product_id} and deleted='0'and  severity='3' and module not REGEXP '${except_id}';",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '提示' FROM zt_bug where product=${product_id} and deleted='0'and severity='4' and module not REGEXP '${except_id}';",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "致命",
                "严重",
                "一般",
                "提示",
                "bug总数"
              ]
            }
          }
        }
      ],
      "type": "stat"
    },
    {
      "aliasColors": {
        "一般": "rgb(253, 216, 53)",
        "严重": "rgb(255, 143, 0)",
        "提示": "rgb(205, 225, 57)",
        "致命": "rgba(245, 54, 54, 0.9)"
      },
      "breakPoint": "100%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_ZENTAO}",
      "decimals": 0,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 10,
        "y": 0
      },
      "id": 21,
      "interval": null,
      "legend": {
        "header": "个数",
        "percentage": true,
        "percentageDecimals": 0,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": "",
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT \r\n  now() as time_sec,\r\n\tsum(case a.severity when '1' then a.num else 0 end) as '致命',\r\n\tsum(case a.severity when '2' then a.num else 0 end) as '严重',\r\n  sum(case a.severity when '3' then a.num else 0 end) as '一般',\r\n\tsum(case a.severity when '4' then a.num else 0 end) as '提示'\r\nfrom (\r\n\tselect severity ,COUNT(severity) as num\r\n\tfrom zt_bug \r\n\twhere product='${product_id}' and deleted='0' and assignedTo!=\"closed\" and module not REGEXP '${except_id}'\r\n\tGROUP BY severity) a",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "未关闭 vs 严重程度",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [
            {
              "id": 0,
              "op": "=",
              "text": "",
              "type": 1,
              "value": "null"
            }
          ],
          "nullValueMode": "connected",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              },
              {
                "color": "#EAB839",
                "value": 90
              },
              {
                "color": "#6ED0E0",
                "value": 100
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-orange",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-green",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "今日新增"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-purple",
                      "value": null
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 2,
        "w": 8,
        "x": 16,
        "y": 0
      },
      "id": 55,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "background",
        "fieldOptions": {
          "calcs": [
            "lastNotNull"
          ]
        },
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "values": false
        }
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '今日新增' FROM zt_bug where product=${product_id} and deleted='0'and date(openedDate)=curdate() and module not REGEXP '${except_id}';",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "activatedCount"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "activatedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '致命' FROM zt_bug where product=${product_id} and deleted='0'and date(openedDate)=curdate() and severity='1' and module not REGEXP '${except_id}';",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '严重' FROM zt_bug where product=${product_id} and deleted='0'and date(openedDate)=curdate() and severity='2' and module not REGEXP '${except_id}';",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '一般' FROM zt_bug where product=${product_id} and deleted='0'and date(openedDate)=curdate() and severity='3' and module not REGEXP '${except_id}';",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '提示' FROM zt_bug where product=${product_id} and deleted='0'and date(openedDate)=curdate() and severity='4' and module not REGEXP '${except_id}';",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "今日新增",
                "致命",
                "严重",
                "一般",
                "提示"
              ]
            }
          }
        }
      ],
      "transparent": true,
      "type": "stat"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [
            {
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "nullValueMode": "connected",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-orange",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-green",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "今日关闭"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-purple",
                      "value": null
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 2,
        "w": 8,
        "x": 16,
        "y": 2
      },
      "id": 53,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "background",
        "fieldOptions": {
          "calcs": [
            "lastNotNull"
          ]
        },
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "values": false
        }
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '今日关闭' FROM zt_bug where product=${product_id} and deleted='0'and date(closedDate)=curdate() and module not REGEXP '${except_id}';",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "activatedCount"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "activatedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '致命' FROM zt_bug where product=${product_id} and deleted='0'and date(closedDate)=curdate() and severity='1' and module not REGEXP '${except_id}';",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '严重' FROM zt_bug where product=${product_id} and deleted='0'and date(closedDate)=curdate() and severity='2' and module not REGEXP '${except_id}';",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '一般' FROM zt_bug where product=${product_id} and deleted='0'and date(closedDate)=curdate() and severity='3' and module not REGEXP '${except_id}';",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '提示' FROM zt_bug where product=${product_id} and deleted='0'and date(closedDate)=curdate() and severity='4' and module not REGEXP '${except_id}';",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "stat"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [
            {
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "nullValueMode": "connected",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "致命占比"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "decimals",
                "value": 1
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重占比"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "decimals",
                "value": 1
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-orange",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般占比"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "decimals",
                "value": 1
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示占比"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "decimals",
                "value": 1
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-green",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-orange",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-green",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "未关闭bug总数"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-purple",
                      "value": null
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 10,
        "x": 0,
        "y": 3
      },
      "id": 51,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "background",
        "fieldOptions": {
          "calcs": [
            "mean"
          ]
        },
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "values": false
        }
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '未关闭bug总数' FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and module not REGEXP '${except_id}';",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "activatedCount"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "activatedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": true,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}') as '一般占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='3';",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": true,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and module not REGEXP '${except_id}' and deleted='0') as '提示占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='4';",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '致命' FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and severity='1' and module not REGEXP '${except_id}';",
          "refId": "F",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '严重' FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and severity='2' and module not REGEXP '${except_id}';",
          "refId": "G",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '一般' FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and severity='3' and module not REGEXP '${except_id}';",
          "refId": "H",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '提示' FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and severity='4' and module not REGEXP '${except_id}';",
          "refId": "I",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) / (SELECT COUNT(*) FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}') as '致命占比' FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and module not REGEXP '${except_id}' and severity='1';",
          "refId": "J",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": true,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}') as '严重占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='2';",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "hide": true,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}') as '严重占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='2';",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}') as '严重占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='2';",
          "refId": "K",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}') as '一般占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='3';",
          "refId": "L",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*)/ (SELECT COUNT(*) FROM zt_bug where product=${product_id} and module not REGEXP '${except_id}' and deleted='0') as '提示占比' FROM zt_bug where product=${product_id} and deleted='0' and module not REGEXP '${except_id}' and assignedTo!=\"closed\" and severity='4';",
          "refId": "M",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "stat"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [
            {
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "nullValueMode": "connected",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "已解决待回归"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-blue",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "激活"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-purple",
                      "value": null
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 4,
        "w": 8,
        "x": 16,
        "y": 4
      },
      "id": 57,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "background",
        "fieldOptions": {
          "calcs": [
            "mean"
          ]
        },
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "values": false
        }
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '激活' FROM zt_bug where product=${product_id} and deleted='0' and status='active' and module not REGEXP '${except_id}';",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "activatedCount"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "activatedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) as '已解决待回归'  FROM zt_bug where product=${product_id} and deleted='0' and assignedTo!=\"closed\" and status='resolved' and module not REGEXP '${except_id}';",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "stat"
    },
    {
      "aliasColors": {
        "关闭": "#5794f2",
        "新增": "#b877d9"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 5,
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "hiddenSeries": false,
      "hideTimeOverride": false,
      "id": 2,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "nullPointMode": "connected",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:2262",
          "alias": "新增",
          "yaxis": 1
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT a.time, @i:=@i+a.num as \"新增\"\nFROM(\nSELECT\n  $__timeGroupAlias(openedDate,1d),\n  count(id) AS \"num\"\nFROM zt_bug\nWHERE\n  product = '$product_id' and module not REGEXP '${except_id}'\nGROUP BY 1\nORDER BY $__timeGroup(openedDate,1d)) a, (SELECT @i:=0) b",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "id"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "新增"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "openedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT a.time, @i:=@i+a.num as \"关闭\"\nFROM(\nSELECT\n  $__timeGroupAlias(closedDate,1d),\n  count(id) AS \"num\"\nFROM zt_bug\nWHERE\n  closedDate > 0 AND\n  product = '$product_id' and module not REGEXP '${except_id}'\nGROUP BY 1\nORDER BY $__timeGroup(closedDate,1d)) a, (SELECT @i:=0) b",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "id"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "关闭"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "closedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            },
            {
              "datatype": "mediumint",
              "name": "",
              "params": [
                "product",
                "=",
                "'$product_id'"
              ],
              "type": "expression"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "hide": true,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT a.time, a.num as \"关闭\"\nFROM(\nSELECT\n  $__timeGroupAlias(closedDate,1d),\n  count(id) AS \"num\"\nFROM zt_bug\nWHERE\n  closedDate > 0 AND\n  product = '$product_id' and module not REGEXP '${except_id}'\nGROUP BY 1\nORDER BY $__timeGroup(closedDate,1d)) a, (SELECT @i:=0) b",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "id"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "关闭"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "zt_bug",
          "timeColumn": "closedDate",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            },
            {
              "datatype": "mediumint",
              "name": "",
              "params": [
                "product",
                "=",
                "'$product_id'"
              ],
              "type": "expression"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "整体收敛趋势",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2275",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:2276",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "center"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "合计"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "gradient-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "percentage",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "orange",
                      "value": 0.1
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "模块"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 120
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 19
      },
      "id": 43,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT m.name as '模块',COUNT(a.new) as '合计',\r\n\tCOUNT(case when a.severity='1' then 1 end) as \"致命\",\r\n\tCOUNT(case when a.severity='2' then 1 end) as \"严重\",\r\n\tCOUNT(case when a.severity='3' then 1 end) as \"一般\",\r\n\tCOUNT(case when a.severity='4' then 1 end) as \"提示\"\r\nfrom(\r\n\tselect b.module,b.severity,m.parent,substring(substring_index(m.path,',',2),2) as new\r\n\tfrom zt_bug b\r\n\tINNER JOIN zt_module m\r\n\ton b.module = m.id\r\n\twhere b.product='${product_id}' and b.deleted='0' and b.module!='0' and b.module not REGEXP '${except_id}') a\r\nINNER JOIN zt_module m\r\non a.new = m.id\r\nGROUP BY a.new \r\norder BY COUNT(a.new) DESC ;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "所有bug模块分布",
      "transformations": [],
      "type": "table"
    },
    {
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "center"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "合计"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "gradient-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "percentage",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "blue",
                      "value": 0.2
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "模块"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 120
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 19
      },
      "id": 45,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT m.name as '模块',COUNT(a.new) as '合计',\r\n\tCOUNT(case when a.severity='1' then 1 end) as \"致命\",\r\n\tCOUNT(case when a.severity='2' then 1 end) as \"严重\",\r\n\tCOUNT(case when a.severity='3' then 1 end) as \"一般\",\r\n\tCOUNT(case when a.severity='4' then 1 end) as \"提示\"\r\nfrom(\r\n\tselect b.module,b.severity,m.parent,substring(substring_index(m.path,',',2),2) as new\r\n\tfrom zt_bug b\r\n\tINNER JOIN zt_module m\r\n\ton b.module = m.id\r\n\twhere b.product='${product_id}' and b.deleted='0' and b.module!='0' and assignedTo!=\"closed\" and b.module not REGEXP '${except_id}') a\r\nINNER JOIN zt_module m\r\non a.new = m.id\r\nGROUP BY a.new\r\norder by COUNT(a.new) desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "未关闭bug模块分布",
      "type": "table"
    },
    {
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "center"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "致命"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 99
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "一般"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "提示"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "未关闭致命"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 95
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "未关闭严重"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 95
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "未关闭一般"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 95
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "未关闭提示"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 95
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "激活的"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "已解决"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "模块"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 160
              },
              {
                "id": "displayName",
                "value": "版本"
              },
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "合计"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "gradient-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "percentage",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "semi-dark-orange",
                      "value": 0
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "未关闭合计"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "gradient-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "percentage",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "blue",
                      "value": 0
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "id": 47,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.0.0",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT a.new as '模块',\r\n\tCOUNT(case when a.severity='1' then 1 end) as \"致命\",\r\n\tCOUNT(case when a.severity='2' then 1 end) as \"严重\",\r\n\tCOUNT(case when a.severity='3' then 1 end) as \"一般\",\r\n\tCOUNT(case when a.severity='4' then 1 end) as \"提示\",\r\n\tcount(*) as \"合计\",\r\n  COUNT(case when a.severity='1' and a.assignedTo!=\"closed\" then 1 end) as \"未关闭致命\",\r\n\tCOUNT(case when a.severity='2' and a.assignedTo!=\"closed\" then 1 end) as \"未关闭严重\",\r\n\tCOUNT(case when a.severity='3' and a.assignedTo!=\"closed\" then 1 end) as \"未关闭一般\",\r\n\tCOUNT(case when a.severity='4' and a.assignedTo!=\"closed\" then 1 end) as \"未关闭提示\",\r\n\tcount(case when a.status='active' then 1 end) as \"激活的\",\r\n\tcount(case when a.assignedTo!=\"closed\" and a.status='resolved' then 1 end) as \"已解决\",\r\n\tcount(case when a.assignedTo!=\"closed\" then 1 end) as \"未关闭合计\"\r\nfrom(\r\n\tselect b.module,b.severity,m.name as new, b.assignedTo, b.status\r\n\tfrom zt_bug b\r\n\tINNER JOIN zt_build m\r\n\ton b.openedBuild = m.id\r\n\twhere b.product='${product_id}' and b.deleted='0' and b.module!='0' and b.module not REGEXP '${except_id}') a\r\nGROUP BY a.new\r\norder BY a.new desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "所有bug版本分布",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 1,
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 42
      },
      "hiddenSeries": false,
      "id": 40,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "connected",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT \r\n  now() as time_sec,\r\n  a.new,\r\n  count(*)\r\nfrom(\r\n\tselect b.module,b.severity,m.name as new, b.assignedTo\r\n\tfrom zt_bug b\r\n\tINNER JOIN zt_build m\r\n\ton b.openedBuild = m.id\r\n\twhere b.product='${product_id}' and b.deleted='0' and b.module!='0' and b.module not REGEXP '${except_id}') a\r\nGROUP BY a.new;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [],
          "hide": true,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT \r\n  now() as time_sec,\r\n  a.new,\r\n\tCOUNT(case when a.severity='2' then 1 end) as \"严重\"\r\nfrom(\r\n\tselect b.module,b.severity,m.name as new, b.assignedTo\r\n\tfrom zt_bug b\r\n\tINNER JOIN zt_build m\r\n\ton b.openedBuild = m.id\r\n\twhere b.product='${product_id}' and b.deleted='0' and b.module!='0' and b.module not REGEXP '${except_id}') a\r\nGROUP BY a.new;",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "所有bug版本趋势",
      "tooltip": {
        "shared": false,
        "sort": 2,
        "value_type": "cumulative"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "series",
        "name": null,
        "show": true,
        "values": [
          "total"
        ]
      },
      "yaxes": [
        {
          "$$hashKey": "object:2563",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:2564",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_ZENTAO}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fontSize": "100%",
      "gridPos": {
        "h": 16,
        "w": 24,
        "x": 0,
        "y": 50
      },
      "id": 36,
      "pageSize": 15,
      "showHeader": true,
      "sort": {
        "col": 5,
        "desc": false
      },
      "styles": [
        {
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "align": "auto",
          "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,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "点击查看详情",
          "linkUrl": "http://chandao.inetposa.com/zentao/bug-view-${__cell_0}.html",
          "mappingType": 1,
          "pattern": "Bug编号",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "",
          "align": "auto",
          "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": true,
          "linkTooltip": "点击查看详情",
          "linkUrl": "http://chandao.inetposa.com/zentao/bug-view-${__cell_0}.html",
          "mappingType": 1,
          "pattern": "缺陷标题",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "align": "auto",
          "colorMode": "value",
          "colors": [
            "#C4162A",
            "#FF780A",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "mappingType": 1,
          "pattern": "严重程度",
          "thresholds": [
            "1.1",
            "2.1"
          ],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "text": "致命",
              "value": "1"
            },
            {
              "text": "严重",
              "value": "2"
            }
          ]
        },
        {
          "alias": "",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 0,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT new.id as 'Bug编号', m.name as '所属模块', new.title as '缺陷标题', new.openedBy as '创建者', new.assignedTo as '指派给' , new.severity as '严重程度'\r\nFROM (\r\nSELECT a.id,a.module,a.title,a.openedBy,a.assignedTo,a.severity,substring(substring_index(b.path,',',2),2) as new_module\r\nFROM zt_bug a\r\nINNER JOIN zt_module b\r\non a.module = b.id\r\nwhere a.product = '${product_id}' and a.deleted!='1' and a.module!='0' and a.module not REGEXP '${except_id}' and a.assignedTo!=\"closed\" and a.severity REGEXP '1|2'\r\n) new\r\nINNER JOIN zt_module m\r\non new.new_module = m.id",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "calledTime"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "zt_entry",
          "timeColumn": "createdDate",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "遗留 Bug_list 致命&严重",
      "transform": "table",
      "type": "table-old"
    }
  ],
  "schemaVersion": 25,
  "style": "dark",
  "tags": [
    "zentao"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_ZENTAO}",
        "definition": "SELECT NAME FROM zt_product WHERE `status`= 'normal';",
        "hide": 0,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "project",
        "options": [],
        "query": "SELECT NAME FROM zt_product WHERE `status`= 'normal';",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_ZENTAO}",
        "definition": "SELECT id FROM zt_product WHERE `name`='${project}';",
        "hide": 2,
        "includeAll": false,
        "label": "product_id",
        "multi": false,
        "name": "product_id",
        "options": [],
        "query": "SELECT id FROM zt_product WHERE `name`='${project}';",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "(1023|1778|1918|1919|1920|2154|2155|2156|2157|2158|2160|2364|2248|2252|2253|2254|2255|2257|2258|2259|2260|2262|2263|2265|2264|2249|2250|2251|1781)",
          "value": "(1023|1778|1918|1919|1920|2154|2155|2156|2157|2158|2160|2364|2248|2252|2253|2254|2255|2257|2258|2259|2260|2262|2263|2265|2264|2249|2250|2251|1781)"
        },
        "hide": 2,
        "label": null,
        "name": "except_id",
        "options": [
          {
            "selected": false,
            "text": "(1023|1778|1918|1919|1920|2154|2155|2156|2157|2158|2160|2364|2248|2252|2253|2254|2255|2257|2258|2259|2260|2262|2263|2265|2264|2249|2250|2251|1781)",
            "value": "(1023|1778|1918|1919|1920|2154|2155|2156|2157|2158|2160|2364|2248|2252|2253|2254|2255|2257|2258|2259|2260|2262|2263|2265|2264|2249|2250|2251|1781)"
          }
        ],
        "query": "(1023|1778|1918|1919|1920|2154|2155|2156|2157|2158|2160|2364|2248|2252|2253|2254|2255|2257|2258|2259|2260|2262|2263|2265|2264|2249|2250|2251|1781)",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-30d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "1 Zentao Dashboard 报告图表",
  "uid": "DfX-mmEWk",
  "version": 93,
  "description": "禅道测试报告图表绘制\n\n2020-5-21 \n1、适配 grafana 7\n2、使用 new table，调整部分样式"
}