Grafana dashboard: Pinba (nginx)
Description: Base dashboard for pinba (nginx) from clickhouse

[https://github.com/pinba-server/pinba-server](https://github.com/pinba-server/pinba-server)

{
  "__inputs": [
    {
      "name": "DS_CLICKHOUSE",
      "label": "clickhouse",
      "description": "",
      "type": "datasource",
      "pluginId": "vertamedia-clickhouse-datasource",
      "pluginName": "ClickHouse"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.4.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "vertamedia-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "1.8.1"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "tags": [
          "deployment"
        ],
        "type": "tags"
      }
    ]
  },
  "description": "Base dashboard for pinba (nginx) from clickhouse",
  "editable": true,
  "gnetId": 10113,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1556472946290,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 0
      },
      "id": 14,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "interval": "",
          "intervalFactor": 10,
          "query": "WITH (\n    CASE \n        WHEN ($interval % 60) = 0 THEN $interval\n    ELSE 60 END\n) AS scale\nSELECT\n    intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,\n    SUM(req_count) as req_count,\n    server_name\nFROM $table\nWHERE\n    $timeFilter\n    AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END\n    AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END\n    AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\nGROUP BY server_name, t\nORDER BY t, req_count desc",
          "rawQuery": "WITH (     CASE          WHEN (3000 % 60) = 0 THEN 3000     ELSE 60 END ) AS scale SELECT     intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,     SUM(req_count) as req_count,     server_name FROM pinba.nginx_report_by_all WHERE     timestamp >= toDateTime(1556299981)     AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END GROUP BY server_name, t ORDER BY t, req_count desc",
          "refId": "A",
          "round": "1m",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "req_count",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 0
      },
      "id": 16,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "interval": "",
          "intervalFactor": 10,
          "query": "WITH (\n    CASE \n        WHEN ($interval % 60) = 0 THEN $interval\n    ELSE 60 END\n) AS scale\nSELECT\n    intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,\n    SUM(req_count) as req_count,\n    script_name\nFROM $table\nWHERE\n    $timeFilter\n    AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END\n    AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END\n    AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\nGROUP BY script_name, t\nHAVING req_count > 10\nORDER BY t, req_count desc",
          "rawQuery": "WITH (     CASE          WHEN (3000 % 60) = 0 THEN 3000     ELSE 60 END ) AS scale SELECT     intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,     SUM(req_count) as req_count,     script_name FROM pinba.nginx_report_by_all WHERE     timestamp >= toDateTime(1556299981)     AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END GROUP BY script_name, t HAVING req_count > 10 ORDER BY t, req_count desc",
          "refId": "A",
          "round": "1m",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "req_count",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 0
      },
      "id": 13,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "intervalFactor": 10,
          "query": "WITH (\n    CASE \n        WHEN ($interval % 60) = 0 THEN $interval\n    ELSE 60 END\n) AS scale\nSELECT\n    intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,\n    SUM(req_count) as req_count,\n    script_name || ':' || toString(status) as script_name\nFROM $table\nWHERE\n    $timeFilter\n    AND status > 200\n    AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END\n    AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END\n    AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\nGROUP BY script_name, t\nHAVING req_count > 10\nORDER BY t, req_count desc",
          "rawQuery": "WITH (     CASE          WHEN (3000 % 60) = 0 THEN 3000     ELSE 60 END ) AS scale SELECT     intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,     SUM(req_count) as req_count,     script_name || ':' || toString(status) as script_name FROM pinba.nginx_report_by_all WHERE     timestamp >= toDateTime(1556299981)     AND status > 200     AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END GROUP BY script_name, t HAVING req_count > 10 ORDER BY t, req_count desc",
          "refId": "A",
          "round": "1m",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "status > 200",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 8
      },
      "id": 11,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "intervalFactor": 10,
          "query": "WITH (\n    CASE \n        WHEN ($interval % 60) = 0 THEN $interval\n    ELSE 60 END\n) AS scale\nSELECT\n    intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,\n    sum(ru_utime_sum) as ru_utime_sum,\n    script_name\nFROM $table\nWHERE\n    $timeFilter\n    AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END\n    AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END\n    AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\n    AND req_count > 1\nGROUP BY script_name, t\nORDER BY t, ru_utime_sum desc",
          "rawQuery": "WITH (     CASE          WHEN (3000 % 60) = 0 THEN 3000     ELSE 60 END ) AS scale SELECT     intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,     sum(ru_utime_sum) as ru_utime_sum,     script_name FROM pinba.nginx_report_by_all WHERE     timestamp >= toDateTime(1556299981)     AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END     AND req_count > 1 GROUP BY script_name, t ORDER BY t, ru_utime_sum desc",
          "refId": "A",
          "round": "1m",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "cpu",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "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": "${DS_CLICKHOUSE}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 8
      },
      "id": 12,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "interval": "",
          "intervalFactor": 10,
          "query": "WITH (\n    CASE \n        WHEN ($interval % 60) = 0 THEN $interval\n    ELSE 60 END\n) AS scale\nSELECT\n    intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,\n    sum(req_time_sum) as req_time_max,\n    script_name\nFROM $table\nWHERE\n    $timeFilter\n    AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END\n    AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END\n    AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\n    AND req_count > 10\nGROUP BY script_name, t\nORDER BY t, req_time_max desc",
          "rawQuery": "WITH (     CASE          WHEN (3000 % 60) = 0 THEN 3000     ELSE 60 END ) AS scale SELECT     intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,     sum(req_time_sum) as req_time_max,     script_name FROM pinba.nginx_report_by_all WHERE     timestamp >= toDateTime(1556299981)     AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END     AND req_count > 10 GROUP BY script_name, t ORDER BY t, req_time_max desc",
          "refId": "A",
          "round": "1m",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "time",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 8
      },
      "id": 15,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "intervalFactor": 10,
          "query": "WITH (\n    CASE \n        WHEN ($interval % 60) = 0 THEN $interval\n    ELSE 60 END\n) AS scale\nSELECT\n    intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,\n    SUM(doc_size_sum) as doc_size_sum,\n    script_name\nFROM $table\nWHERE\n    $timeFilter\n    AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END\n    AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END\n    AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\n    AND req_count > 10\nGROUP BY script_name, t\nORDER BY t, doc_size_sum desc",
          "rawQuery": "WITH (     CASE          WHEN (3000 % 60) = 0 THEN 3000     ELSE 60 END ) AS scale SELECT     intDiv(toUInt32(timestamp), scale) * scale * 1000 AS t,     SUM(doc_size_sum) as doc_size_sum,     script_name FROM pinba.nginx_report_by_all WHERE     timestamp >= toDateTime(1556299981)     AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END     AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END     AND req_count > 10 GROUP BY script_name, t ORDER BY t, doc_size_sum desc",
          "refId": "A",
          "round": "1m",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "doc_size",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbits",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "decbits",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_CLICKHOUSE}",
      "fontSize": "100%",
      "gridPos": {
        "h": 4,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 10,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": null,
        "desc": false
      },
      "styles": [],
      "targets": [
        {
          "database": "pinba",
          "dateLoading": false,
          "dateTimeColDataType": "timestamp",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "expr": "",
          "format": "table",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "intervalFactor": 1,
          "query": "WITH ($to - $from) AS seconds \nSELECT\n    script_name\n    , req_time_max / req_count AS req_time_avg\n    , max(req_time_max) AS req_time_max\n    , sum(req_time_sum) AS req_time_sum_sum\n    , sum(req_count) AS req_count\n    \nFROM $table\nWHERE $timeFilter\n  AND CASE WHEN $schema <> 'all' THEN schema = $schema ELSE 1 END \n  AND CASE WHEN $hostname <> 'all' THEN hostname = $hostname ELSE 1 END \n  AND CASE WHEN $server_name <> 'all' THEN server_name = $server_name ELSE 1 END\nGROUP BY script_name\nORDER BY req_time_avg DESC \nLIMIT 20",
          "rawQuery": "WITH (1556472974 - 1556300116) AS seconds  SELECT     script_name     , req_time_max / req_count AS req_time_avg     , max(req_time_max) AS req_time_max     , sum(req_time_sum) AS req_time_sum_sum     , sum(req_count) AS req_count      FROM pinba.nginx_report_by_all WHERE timestamp >= toDateTime(1556300116)   AND CASE WHEN 'all' <> 'all' THEN schema = 'all' ELSE 1 END    AND CASE WHEN 'all' <> 'all' THEN hostname = 'all' ELSE 1 END    AND CASE WHEN 'all' <> 'all' THEN server_name = 'all' ELSE 1 END GROUP BY script_name ORDER BY req_time_avg DESC  LIMIT 20",
          "refId": "A",
          "round": "15s",
          "table": "nginx_report_by_all",
          "tableLoading": false
        }
      ],
      "title": "TOP 10 slow scripts",
      "transform": "table",
      "type": "table"
    }
  ],
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "php",
    "performance"
  ],
  "templating": {
    "list": [
      {
        "allValue": "'all'",
        "current": {},
        "datasource": "${DS_CLICKHOUSE}",
        "definition": "SELECT DISTINCT schema FROM pinba.nginx_report_by_all WHERE timestamp >= toStartOfDay(now())",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": false,
        "name": "schema",
        "options": [],
        "query": "SELECT DISTINCT schema FROM pinba.nginx_report_by_all WHERE timestamp >= toStartOfDay(now())",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": "'all'",
        "current": {},
        "datasource": "${DS_CLICKHOUSE}",
        "definition": "SELECT server_name FROM pinba.nginx_report_by_all WHERE timestamp >= toStartOfDay(now()) GROUP BY server_name ORDER BY sum(req_count) desc",
        "hide": 0,
        "includeAll": true,
        "label": "server name",
        "multi": false,
        "name": "server_name",
        "options": [],
        "query": "SELECT server_name FROM pinba.nginx_report_by_all WHERE timestamp >= toStartOfDay(now()) GROUP BY server_name ORDER BY sum(req_count) desc",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": "'all'",
        "current": {},
        "datasource": "${DS_CLICKHOUSE}",
        "definition": "SELECT DISTINCT hostname FROM pinba.nginx_report_by_all WHERE timestamp >= toStartOfDay(now())",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": false,
        "name": "hostname",
        "options": [],
        "query": "SELECT DISTINCT hostname FROM pinba.nginx_report_by_all WHERE timestamp >= toStartOfDay(now())",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-2d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Pinba (nginx)",
  "uid": "FmBfAtkZz",
  "version": 7
}