{
  "__inputs": [
    {
      "name": "DS_MYMYSQL",
      "label": "MyMySQL",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "panel",
      "id": "heatmap",
      "name": "Heatmap",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "My MySQL simple dashboard",
  "editable": true,
  "gnetId": 7991,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1579811949350,
  "links": [
    {
      "icon": "external link",
      "tags": [
        "MyMySQL"
      ],
      "type": "dashboards"
    },
    {
      "icon": "external link",
      "includeVars": false,
      "tags": [],
      "targetBlank": true,
      "title": "Meo's Site",
      "type": "link",
      "url": "https://www.xenialab.it/meo/web/index5.htm#my"
    }
  ],
  "panels": [
    {
      "content": "<div style=\"text-align: center;\">$MyInstance -- <b>$MyVar</b></div>",
      "datasource": "${DS_MYMYSQL}",
      "gridPos": {
        "h": 2,
        "w": 20,
        "x": 0,
        "y": 0
      },
      "id": 32,
      "links": [],
      "mode": "html",
      "options": {},
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": false,
          "rawSql": "SELECT\n  c1 AS \"time\",\n  v1\nFROM mylog\nWHERE\n  $__timeFilter(c1)\nORDER BY c1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "v1"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "mylog",
          "timeColumn": "c1",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Connection Info",
      "transparent": true,
      "type": "text"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 20,
        "y": 0
      },
      "id": 20,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(timest) as time_sec,\n  variable_value/600 as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  AND variable_name='CONNECTIONS-d'\n  AND variable_value>=0\nORDER BY timest ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "title": "Connections/sec",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "aliasColors": {
        "ABORTED_CLIENTS": "#bf1b00",
        "ABORTED_CLIENTS-d": "#890f02",
        "ABORTED_CONNECTS": "#f29191",
        "Aborted_clients-d": "#c15c17",
        "Aborted_connects-d": "#cca300",
        "SLOW_QUERIES": "#e24d42",
        "SLOW_QUERIES-d": "#cca300",
        "Slow_queries": "#99440a",
        "Slow_queries-d": "#890f02",
        "THREADS_CONNECTED": "#3f6833",
        "THREADS_RUNNING": "#cca300",
        "Threads_connected": "#64b0c8"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$MyInstance",
      "fill": 5,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 0,
        "y": 2
      },
      "hiddenSeries": false,
      "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",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "SLOW_QUERIES",
          "fill": 0,
          "yaxis": 2
        },
        {
          "alias": "ABORTED_CLIENTS",
          "fill": 0,
          "yaxis": 2
        },
        {
          "alias": "ABORTED_CONNECTS",
          "fill": 0,
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT $__timeGroup(timest, '10m') AS time,\n       variable_name as metric,\n       avg(variable_value+0) as value\n  FROM my2.status\n WHERE $__timeFilter(timest)\n   AND variable_name in ('THREADS_CONNECTED', 'THREADS_RUNNING')\n GROUP BY 1,2\n ORDER BY 1 ASC",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroup(timest, '10m') as time,\n  substr(variable_name,1,length(variable_name)-2) as metric,\n  avg(variable_value+0) as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  and variable_name in ('SLOW_QUERIES-d', 'ABORTED_CONNECTS-d','ABORTED_CLIENTS-d')\n  and variable_value>=0\nGROUP BY 1,2\nORDER BY 1 ASC\n",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [
        {
          "colorMode": "gray",
          "fill": true,
          "fromDayOfWeek": 6,
          "line": false,
          "op": "time",
          "toDayOfWeek": 7
        }
      ],
      "timeShift": null,
      "title": "Threads & Errors",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 0,
          "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
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$MyInstance",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 10,
        "y": 2
      },
      "hiddenSeries": false,
      "id": 4,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 3,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "SIZEDB.TOTAL",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroup(timest,'24h') as time,\n  variable_name as metric,\n  avg(variable_value+0) as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  and variable_name in ('SIZEDB.TOTAL')\nGROUP BY 1,2\nORDER BY 1 ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": "60d",
      "timeRegions": [
        {
          "colorMode": "gray",
          "fill": true,
          "fromDayOfWeek": 6,
          "line": false,
          "op": "time",
          "toDayOfWeek": 7
        }
      ],
      "timeShift": null,
      "title": "Space usage",
      "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": false
        },
        {
          "format": "bytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": true,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 20,
        "y": 2
      },
      "id": 41,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT $__timeGroup(s1.timest,'30m') as time_sec,\n  avg(1-s1.variable_value/s2.variable_value)*100 as value\nFROM my2.status s1,  my2.status s2\nWHERE $__timeFilter(s1.timest)\n  AND s1.timest=s2.timest\n  AND s1.variable_name='INNODB_BUFFER_POOL_READS-d'\n  AND s2.variable_name='INNODB_BUFFER_POOL_READ_REQUESTS-d'\n  AND s2.variable_value>0\nGROUP BY 1\nORDER BY 1 ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "95,98",
      "title": "InnoDB Cache Hit",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": true,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 20,
        "y": 6
      },
      "id": 42,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT $__timeGroup(s1.timest,'30m') as time_sec,\n  avg(1-s1.variable_value/s2.variable_value)*100 as value\nFROM my2.status s1,  my2.status s2\nWHERE $__timeFilter(s1.timest)\n  AND s1.timest=s2.timest\n  AND s1.variable_name='KEY_READS-d'\n  AND s2.variable_name='KEY_READ_REQUESTS-d'\n  AND s2.variable_value>0\nGROUP BY 1\nORDER BY 1 ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "95,98",
      "title": "MyISAM Cache Hit",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "aliasColors": {
        "DELETE": "#bf1b00",
        "DELETE_MULTI": "#bf1b00",
        "INSERT": "#629e51",
        "INSERT_SELECT": "#3f6833",
        "SELECT": "#5195ce",
        "UPDATE": "#cca300",
        "UPDATE_MULTI": "#f2c96d"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$MyInstance",
      "fill": 5,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 0,
        "y": 8
      },
      "hiddenSeries": false,
      "id": 6,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "SELECT",
          "yaxis": 1
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT $__timeGroup(timest, '10m') AS time,\n       substr(variable_name,5,length(variable_name)-6) as metric,\n       avg(variable_value/600) as value\n  FROM my2.status\n WHERE $__timeFilter(timest)\n   and variable_name in ('COM_SELECT-d', 'COM_INSERT-d', 'COM_UPDATE-d', 'COM_DELETE-d')\n   and variable_value >=0\n GROUP BY 1,2\n ORDER BY 1 ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [
        {
          "colorMode": "gray",
          "fill": true,
          "fromDayOfWeek": 6,
          "line": false,
          "op": "time",
          "toDayOfWeek": 7
        }
      ],
      "timeShift": null,
      "title": "SQL Commands /sec",
      "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": "ops",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$MyInstance",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 10,
        "y": 8
      },
      "hiddenSeries": false,
      "id": 8,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "BYTES_SENT-d",
          "yaxis": 2
        },
        {
          "alias": "BYTES_RECEIVED-d",
          "transform": "negative-Y",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT $__timeGroup(timest, '10m') AS time,\n       variable_name as metric,\n       avg(variable_value+0)/600 as value\n  FROM my2.status\n WHERE $__timeFilter(timest)\n   and variable_name in ('Bytes_received-d', 'Bytes_sent-d')\n GROUP BY 1,2\n ORDER BY 1 ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [
        {
          "colorMode": "gray",
          "fill": true,
          "fromDayOfWeek": 6,
          "line": false,
          "op": "time",
          "toDayOfWeek": 7
        }
      ],
      "timeShift": null,
      "title": "Network",
      "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": false
        },
        {
          "format": "Bps",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": true,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 20,
        "y": 9
      },
      "id": 43,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT $__timeGroup(s1.timest,'30m') as time_sec,\n  avg((s1.variable_value/(s1.variable_value+s2.variable_value))*100) as value\nFROM my2.status s1,  my2.status s2\nWHERE $__timeFilter(s1.timest)\n  AND s1.timest=s2.timest\n  AND s1.variable_name='QCACHE_HITS-d'\n  AND s2.variable_name='COM_SELECT-d'\n  AND s2.variable_value>0\nGROUP BY 1\nORDER BY 1 ASC\n\n\n\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "30,50",
      "title": "Query Cache Hit",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 20,
        "y": 12
      },
      "id": 36,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(timest) as time_sec,\n  sum(variable_value+0) as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  AND variable_name like 'PROCESSES_COMMAND.Binlog Dump%'\nGROUP BY timest\nORDER BY timest ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0.5,0.6",
      "title": "Master - Connected Slaves",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$MyInstance",
      "fill": 2,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 0,
        "y": 14
      },
      "hiddenSeries": false,
      "id": 10,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/_sec/",
          "color": "#3f6833",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(timest) as time,\n  variable_value+0 as value, variable_value/600 as value_sec,\n  variable_name as metric\nFROM my2.status\nWHERE $__timeFilter(timest)\n  and variable_name in ($MyStatistics)\nORDER BY timest ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [
        {
          "colorMode": "gray",
          "fill": true,
          "fromDayOfWeek": 6,
          "line": false,
          "op": "time",
          "toDayOfWeek": 7
        }
      ],
      "timeShift": null,
      "title": "Custom Statistic",
      "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": "",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateRdYlGn",
        "exponent": 0.5,
        "max": null,
        "min": null,
        "mode": "spectrum"
      },
      "dataFormat": "tsbuckets",
      "datasource": "$MyInstance",
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 10,
        "y": 14
      },
      "heatmap": {},
      "hideTimeOverride": false,
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 18,
      "legend": {
        "show": true
      },
      "links": [],
      "options": {},
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroup(timest, '24h') as time,\n  concat(' ',max(date_format(timest,'%H'))) as metric,\n  sum(variable_value)/3600 as value\nFROM my2.status\nWHERE variable_name='QUERIES-d'\n  and variable_value>0\n  and $__timeFilter(timest)\nGROUP BY $__timeGroup(timest, '1h'),$__timeGroup(timest, '24h')\nORDER BY 2, 1 \n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": "14d",
      "timeShift": null,
      "title": "Heatmap (Queries /sec)",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "tooltipDecimals": null,
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 20,
        "y": 14
      },
      "id": 37,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(timest) as time_sec,\n  variable_value+0 as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  AND variable_name ='replication_connection_status'\nORDER BY timest ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0.5,0.6",
      "title": "Slave - IO Thread",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 20,
        "y": 16
      },
      "id": 45,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(timest) as time_sec,\n  variable_value+0 as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  AND variable_name ='replication_applier_status'\nORDER BY timest ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0.5,0.6",
      "title": "Slave - SQL Thread",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "$MyInstance",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 4,
        "x": 20,
        "y": 18
      },
      "id": 38,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(timest) as time_sec,\n  variable_value+0 as value\nFROM my2.status\nWHERE $__timeFilter(timest)\n  AND (variable_name ='replication_worker_time' OR variable_name ='replication_max_worker_time')\nORDER BY timest ASC\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0.1,1.0",
      "title": "Slave - sec. behind Master",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "content": "",
      "datasource": "$MyInstance",
      "gridPos": {
        "h": 1,
        "w": 10,
        "x": 0,
        "y": 20
      },
      "id": 44,
      "links": [],
      "mode": "html",
      "options": {},
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  c1 AS \"time\",\n  v1\nFROM mylog\nWHERE\n  $__timeFilter(c1)\nORDER BY c1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "v1"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "mylog",
          "timeColumn": "c1",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "$MyVar2",
      "transparent": true,
      "type": "text"
    },
    {
      "content": "<a href=\"https://github.com/meob/my2Collector\">Github</a>",
      "datasource": "${DS_MYMYSQL}",
      "gridPos": {
        "h": 1,
        "w": 10,
        "x": 10,
        "y": 20
      },
      "id": 46,
      "links": [],
      "mode": "html",
      "options": {},
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": false,
          "rawSql": "SELECT\n  c1 AS \"time\",\n  v1\nFROM mylog\nWHERE\n  $__timeFilter(c1)\nORDER BY c1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "v1"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "mylog",
          "timeColumn": "c1",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "This dashboard uses my2 collector (https://github.com/meob/my2Collector)",
      "transparent": true,
      "type": "text"
    },
    {
      "content": "<a href=\"https://www.xenialab.it\">XeniaLAB</a>",
      "datasource": "${DS_MYMYSQL}",
      "gridPos": {
        "h": 1,
        "w": 4,
        "x": 20,
        "y": 20
      },
      "id": 40,
      "links": [],
      "mode": "html",
      "options": {},
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": false,
          "rawSql": "SELECT\n  c1 AS \"time\",\n  v1\nFROM mylog\nWHERE\n  $__timeFilter(c1)\nORDER BY c1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "v1"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "mylog",
          "timeColumn": "c1",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "by XeniaLAB",
      "transparent": true,
      "type": "text"
    }
  ],
  "refresh": false,
  "schemaVersion": 21,
  "style": "dark",
  "tags": [
    "MyMySQL"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "text": "MyMySQL",
          "value": "MyMySQL"
        },
        "hide": 1,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "MyInstance",
        "options": [],
        "query": "mysql",
        "refresh": 1,
        "regex": "/.*/",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$MyInstance",
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "Custom Statistic",
        "multi": true,
        "name": "MyStatistics",
        "options": [],
        "query": "select distinct variable_name from my2.status where variable_name is not null and variable_name <>'' order by 1",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$MyInstance",
        "definition": "select concat( @@hostname,':', @@port)",
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "MyVar",
        "options": [],
        "query": "select concat( @@hostname,':', @@port)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$MyInstance",
        "definition": "select concat('MySQL version: ',version(), '   Created at: ', date_format(min(create_time),'%Y-%m-%d %T') ,\n  '  Started at: ', date_format(date_sub(now(), INTERVAL variable_value second),'%Y-%m-%d %T')) info\n  from   information_schema.tables,performance_schema.global_status\n where variable_name='UPTIME'\n group by variable_value\n",
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "MyVar2",
        "options": [],
        "query": "select concat('MySQL version: ',version(), '   Created at: ', date_format(min(create_time),'%Y-%m-%d %T') ,\n  '  Started at: ', date_format(date_sub(now(), INTERVAL variable_value second),'%Y-%m-%d %T')) info\n  from   information_schema.tables,performance_schema.global_status\n where variable_name='UPTIME'\n group by variable_value\n",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "2MySQL  Simple Dashboard",
  "uid": "4Z1opp5mk",
  "version": 153
}