{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      },
      {
        "datasource": "${DataSource}",
        "enable": true,
        "iconColor": "blue",
        "name": "DB事件(蓝色线)",
        "rawQuery": "/* rds internal mark */\n SELECT\n  time,\n  string_agg(event_content, E'\\n\\n') AS text,\n  'PolarDB,' || string_agg(distinct event_type, ',')  AS tags\nFROM \n(\nSELECT time - time % (($__interval_ms / 1000)::INTEGER) AS time, \nevent_type AS event_type,\nE'<b>Type: ' || event_type || E'</b>, <b> Total Event Counts: </b>' || COUNT(*) || '<br /><b>Sample:</b><br />' || MAX(event_content) || E'<br />' AS event_content, COUNT(*) AS event_count\n\nFROM ${LogicInstance}.view_fact_polar_event\nWHERE\n  time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND\n  physical_ins_name='${PhysicalInstance}' AND level != 'INFO' AND (event_type NOT IN ('ERROR', 'FATAL') OR (event_type IN ('ERROR', 'FATAL') AND split_part(event_content, E'\\t', 4) IN ('', 'replicator', 'postgres', 'aurora') AND event_content NOT LIKE '%polar_is_available%' AND event_content NOT LIKE '%polar_parameter_manager%'))\nGROUP BY   time - time % (($__interval_ms / 1000)::INTEGER), event_type\n) a\nGROUP BY time\nORDER BY 1\n"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": 1,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 91,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "Summary",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 数据库计算节点的角色，分为读写节点RW和只读节点RO。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "fillOpacity": 70,
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineWidth": 0,
            "spanNulls": false
          },
          "mappings": [
            {
              "options": {
                "RO": {
                  "color": "yellow",
                  "index": 1,
                  "text": "RO"
                },
                "RW": {
                  "color": "light-red",
                  "index": 0,
                  "text": "RW"
                },
                "Standby": {
                  "color": "purple",
                  "index": 2,
                  "text": "Standby"
                }
              },
              "type": "value"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "id": 63,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "alignValue": "center",
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "mergeValues": true,
        "rowHeight": 0.65,
        "showValue": "always",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % ((($__interval_ms / 1000)::INTEGER)::integer) AS time,\n  MAX(role) AS Role\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "角色",
      "type": "state-timeline"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 数据库实例的版本信息，包括了发布时间和版本号。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "fillOpacity": 70,
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineWidth": 0,
            "spanNulls": false
          },
          "mappings": [
            {
              "options": {
                "from": 0,
                "result": {
                  "color": "light-green",
                  "index": 0
                },
                "to": 2
              },
              "type": "range"
            },
            {
              "options": {
                "from": 3,
                "result": {
                  "color": "semi-dark-green",
                  "index": 1
                },
                "to": 4
              },
              "type": "range"
            },
            {
              "options": {
                "from": 5,
                "result": {
                  "color": "dark-green",
                  "index": 2
                },
                "to": 8
              },
              "type": "range"
            },
            {
              "options": {
                "from": 9,
                "result": {
                  "color": "light-blue",
                  "index": 3
                },
                "to": 16
              },
              "type": "range"
            },
            {
              "options": {
                "from": 17,
                "result": {
                  "color": "semi-dark-blue",
                  "index": 4
                },
                "to": 32
              },
              "type": "range"
            },
            {
              "options": {
                "from": 33,
                "result": {
                  "color": "dark-blue",
                  "index": 5
                },
                "to": 64
              },
              "type": "range"
            },
            {
              "options": {
                "from": 65,
                "result": {
                  "color": "light-orange",
                  "index": 6
                },
                "to": 128
              },
              "type": "range"
            },
            {
              "options": {
                "from": 129,
                "result": {
                  "color": "semi-dark-orange",
                  "index": 7
                },
                "to": 256
              },
              "type": "range"
            },
            {
              "options": {
                "from": 257,
                "result": {
                  "color": "dark-orange",
                  "index": 8
                },
                "to": 512
              },
              "type": "range"
            },
            {
              "options": {
                "from": 513,
                "result": {
                  "color": "light-red",
                  "index": 9
                },
                "to": 1024
              },
              "type": "range"
            },
            {
              "options": {
                "from": 1025,
                "result": {
                  "color": "semi-dark-red",
                  "index": 10
                },
                "to": 2048
              },
              "type": "range"
            },
            {
              "options": {
                "from": 2049,
                "result": {
                  "color": "dark-red",
                  "index": 11
                },
                "to": 4096
              },
              "type": "range"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "id": 64,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "alignValue": "center",
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "mergeValues": true,
        "rowHeight": 0.65,
        "showValue": "always",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  MAX(version) AS Version\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "版本",
      "type": "state-timeline"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 数据库实例当前占用的CPU情况",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "blue",
            "mode": "fixed"
          },
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 0,
        "y": 4
      },
      "id": 58,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  (AVG(cpu_user_usage) + AVG(pfsd_cpu_user / cpu_cores) + AVG(cpu_sys_usage) + AVG(pfsd_cpu_sys / cpu_cores))\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "CPU",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前数据库实例的内存占用情况",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "orange",
            "mode": "fixed"
          },
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 3,
        "y": 4
      },
      "id": 59,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(mem_total_usage)\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Memory",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前数据库实例的IO吞吐情况，侧面反映此时的IO繁忙程度。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "green",
            "mode": "fixed"
          },
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "MBs"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 6,
        "y": 4
      },
      "id": 147,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(pls_throughput_read + pls_throughput_write)\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "IO",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前数据库实例的磁盘空间使用率。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "light-red",
            "mode": "fixed"
          },
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 9,
        "y": 4
      },
      "id": 61,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(fs_blocks_usage)\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "空间使用率",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前时间窗口内的平均TPS。\n\n指标来源&采集方式：\n- 从pg_stat_database视图中获取SUM(xact_commit) + SUM(xact_rollback)  ，采集时会对相应指标做差值处理。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "green",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 12,
        "y": 4
      },
      "id": 56,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(commits_delta+rollbacks_delta) AS TPS\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "TPS",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前活跃连接数，反应当前时间窗口数据库的繁忙程度。\n\n指标来源&采集方式：\n- 源数据视图：pg_stat_activity，过滤条件：SUM(CASE WHEN state IN ('active') THEN 1 ELSE 0 END) ，汇总当前所有active的backend sessions。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "yellow",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 15,
        "y": 4
      },
      "id": 57,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(active_connections) AS 活跃连接\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Active Connections",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前指定时间窗口内数据库blk读取的平均缓存命中率。\n\n指标来源&采集方式：\n- 源数据视图：pg_stat_database。blks_hit：缓冲区命中的块数，这些块直接在buffer中无需磁盘读取。blks_read：从磁盘读取的块数。命中率：blks_hit/(blks_hit+blks_read)。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "purple",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 18,
        "y": 4
      },
      "id": 60,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(blks_hit_delta / (blks_hit_delta + blks_read_delta + 1))\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "缓存命中率",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 当前RW实例挂的若干个RO中最慢那个现在的延迟情况\n- 该panel仅在RW节点中展示\n\n指标来源&采集方式：\n- 源数据视图：pg_stat_replication视图中的replay_lag指标，统计application_name为replica%的延迟最大值。（当前延迟最大的RO节点的延迟时间）。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "orange",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 21,
        "y": 4
      },
      "id": 146,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value",
        "wideLayout": true
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  MAX(replay_lag_in_ms) AS replay\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_pg_stat_replication, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND application_name like 'replica%'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "RO同步延迟",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 监控实例中的会话处于什么等待事件上, 如果没有等待事件则被认为在使用CPU. 该柱状图表达了每种等待事件平均1秒的会话个数. 与Oracle ASH的含义一致.\n\n指标来源&采集方式：\n- 等待事件通过原生视图pg_stat_acivity采集，采集粒度为秒，等待事件字段：wait_event_type和wait_event, 当wait_event为NULL时, 则被认为该会话在使用CPU",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 100,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 9,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  wait_event_type::text || ':' || wait_event AS metric,\n  CASE WHEN ($__interval_ms / 1000) >= 3600 THEN ROUND(CAST(SUM(wait_count) AS NUMERIC) / (($__interval_ms / 3600 / 1000)::INTEGER), 2)::FLOAT\n      WHEN ($__interval_ms / 1000) >= 60 THEN ROUND(CAST(SUM(wait_count) AS NUMERIC) / (($__interval_ms / 60 / 1000)::INTEGER), 2)::FLOAT\n      ELSE ROUND(CAST(SUM(wait_count) AS NUMERIC) / (($__interval_ms / 1000)::INTEGER), 2)::FLOAT END AS wait_count\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_aas_history, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), metric\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Average Active Session",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 19
      },
      "id": 18,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "Resource - CPU",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 20
      },
      "id": 28,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "CPU",
      "type": "text"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 数据库用户态: 用户态cpu使用情况\n- 数据库系统态: 系统态cpu使用情况\n",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 20,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "%"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 9,
        "x": 0,
        "y": 21
      },
      "id": 54,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(cpu_user_usage) + AVG(pfsd_cpu_user / cpu_cores) AS 数据库用户态,\n  AVG(cpu_sys_usage) + AVG(pfsd_cpu_sys / cpu_cores) AS 数据库系统态\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "CPU使用率",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 在当前指定时间窗口下，数据库实例每种类型的进程分别占用了多少cpu，根据进程类型堆叠展示。此cpu占用值包括了系统态与用户态\n- client backend进程是会话进程, 由于会话数量可能在不断变化, 难以准确采集CPU增量值, 所以存在*部分误差*\n\n指标来源&采集方式：\n- 通过polar_stat_process视图获取，内核从每个进程的/proc/%pid/stat文件下获取cpu占用情况，其中cpu使用率为累积值，展示的已是基于指定时间窗口做差后的结果。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 100,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "%"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 15,
        "x": 9,
        "y": 21
      },
      "id": 4,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT time, metric, cpu FROM (\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  backend_type AS metric,\n  AVG(cpu_user+cpu_sys) / (SELECT cpu_cores FROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER) ORDER BY time DESC LIMIT 1) AS cpu\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_process, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND\n  $__unixEpochFilter(time)\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), backend_type\nUNION ALL\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  'postmaster' AS metric,\n  AVG(postmaster_cpu) AS cpu\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND\n  $__unixEpochFilter(time)\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nUNION ALL\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  'logger' AS metric,\n  AVG(logger_cpu) AS cpu\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND\n  $__unixEpochFilter(time)\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nUNION ALL\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  'pgstat' AS metric,\n  AVG(pgstat_cpu) AS cpu\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND\n  $__unixEpochFilter(time)\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\n) a ORDER BY time",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "CPU: 按进程类型堆叠",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 33
      },
      "id": 190,
      "panels": [],
      "title": "Resource - Memory",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 34
      },
      "id": 84,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "Memory",
      "type": "text"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 在当前指定时间窗口下，数据库实例的内存使用情况",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 9,
        "x": 0,
        "y": 35
      },
      "hiddenSeries": false,
      "id": 53,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  MAX(mem_total_usage) AS 内存使用率\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "内存使用率",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "%",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 在当前指定时间窗口下，各类型的进程当前的私有内存使用情况汇总。\n\n指标来源&采集方式：\n- 字段来源：polar_stat_process的rss列。指标获取方式：读取每个进程所对应的/proc/%pid/statm文件，提取Rss与Share值，最后将Rss - Share的值作为最终该进程的私有内存占用情况输出。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 100,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 3,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decmbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 15,
        "x": 9,
        "y": 35
      },
      "id": 13,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT time, metric, rss FROM (\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  backend_type AS metric,\n  AVG(rss) AS rss\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_process, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), backend_type\nUNION ALL\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  'postmaster' AS metric,\n  AVG(postmaster_mem) AS rss\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nUNION ALL\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  'pgstat' AS metric,\n  AVG(pgstat_mem) AS rss\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nUNION ALL\nSELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  'logger' AS metric,\n  AVG(logger_mem) AS rss\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\n) a ORDER BY time",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Memory: 按进程类型堆叠",
      "type": "timeseries"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 在当前指定时间窗口下，占用私有内存最多的若干个进程，并展示采集的时间点、RSS情况、query信息。\n\n指标来源&采集方式：\n- 从polar_stat_process视图按照rss大小过滤。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 938
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 177
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "RSS(MB)"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 127
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "进程id"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 115
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "对应时间点"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 173
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 0,
        "y": 47
      },
      "id": 116,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n                             SELECT pid AS 进程id, rss_mb AS \"RSS(MB)\", TO_CHAR(TO_TIMESTAMP(time), 'YYYY-MM-DD HH24:MI:SS') AS 对应时间点, query AS query\n                            FROM ${LogicInstance}.view_fact_polar_stat_max_memory_sql \n                            WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                            ORDER BY rss_mb DESC, time DESC LIMIT 10\n\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 内存占用会话 (200MB以上)",
      "type": "table"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 在当前指定时间窗口下，列出此时占用内存最多的那个进程的Memory Contex信息，更细粒度窥探此进程的内存占用细节。\n\n指标来源&采集方式：\n- 先从polar_stat_process视图过滤出占用rss最大的进程pid，然后调用polar_get_mcxt()函数获取该进程的所有memory context，最后取较大的若干个作为结果集输出。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 938
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 177
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "RSS(MB)"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 127
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "进程id"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 115
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "对应时间点"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 173
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 12,
        "y": 47
      },
      "id": 162,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n                             SELECT pid AS 进程id, name AS \"Memory Context\", totalspace / 1024 / 1024 AS \"MB\", TO_CHAR(TO_TIMESTAMP(time), 'YYYY-MM-DD HH24:MI:SS') AS 对应时间点\n                            FROM ${LogicInstance}.view_fact_polar_max_memory_backend_memory_context\n                            WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                            ORDER BY totalspace DESC, time DESC LIMIT 10\n\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top Memory Context",
      "type": "table"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 59
      },
      "id": 192,
      "panels": [],
      "title": "Resource - IO",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 60
      },
      "id": 85,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "共享存储IO",
      "type": "text"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例的共享存储介质的磁盘读写IOPS\n",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 0,
        "y": 61
      },
      "id": 14,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(pls_iops_read) AS read,\n  AVG(pls_iops_write) AS write\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "IOPS",
      "type": "timeseries"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例的共享存储介质的磁盘读写带宽",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decmbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 8,
        "y": 61
      },
      "id": 16,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [
            "mean"
          ],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(pls_throughput_read) AS read,\n  AVG(pls_throughput_write) AS write\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "带宽",
      "type": "timeseries"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例的共享存储介质的磁盘读写延迟",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "µs"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 16,
        "y": 61
      },
      "id": 15,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(pls_latency_read) AS read,\n  AVG(pls_latency_write) AS write\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "平均延迟",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 70
      },
      "id": 86,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "数据库IO: 文件类型维度",
      "type": "text"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，共享存储介质中的读操作在各类型文件上的IOPS分布情况。\n\n指标来源&采集方式：\n- 通过polar_stat_io_info函数在每个进程类型维度上的IO信息累加得到上述指标。\n- polar_stat_io_info：对每个进程的io详细信息进行各个维度的展示。进程在什么类型的文件上（WAL/DATA/logindex）进行了什么操作（seek/read/write/fsync/falloc）。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 0,
        "y": 71
      },
      "hiddenSeries": false,
      "id": 72,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  filetype AS metric,\n  AVG(read_count) AS read_iops\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_info, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND fileloc='pfs'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), filetype\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "PFS read iops",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "none",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，共享存储介质中的写操作在各类型文件上的IOPS分布情况。\n\n指标来源&采集方式：\n- 通过polar_stat_io_info函数在每个进程类型维度上的IO信息累加得到上述指标。\n- polar_stat_io_info：对每个进程的io详细信息进行各个维度的展示。进程在什么类型的文件上（WAL/DATA/logindex）进行了什么操作（seek/read/write/fsync/falloc）。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 6,
        "y": 71
      },
      "hiddenSeries": false,
      "id": 73,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  filetype AS metric,\n  AVG(write_count) AS write_iops\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_info, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND fileloc='pfs'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), filetype\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "PFS write iops",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "none",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，共享存储介质中的seek操作在各类型文件上的IOPS分布情况。\n\n指标来源&采集方式：\n- 通过polar_stat_io_info函数在每个进程类型维度上的IO信息累加得到上述指标。\n- polar_stat_io_info：对每个进程的io详细信息进行各个维度的展示。进程在什么类型的文件上（WAL/DATA/logindex）进行了什么操作（seek/read/write/fsync/falloc）。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 12,
        "y": 71
      },
      "hiddenSeries": false,
      "id": 74,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  filetype AS metric,\n  AVG(seek_count) AS seek_iops\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_info, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND fileloc='pfs'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), filetype\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "PFS seek iops",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "none",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，共享存储介质中的open操作在各类型文件上的IOPS分布情况。\n\n指标来源&采集方式：\n- 通过polar_stat_io_info函数在每个进程类型维度上的IO信息累加得到上述指标。\n- polar_stat_io_info：对每个进程的io详细信息进行各个维度的展示。进程在什么类型的文件上（WAL/DATA/logindex）进行了什么操作（seek/read/write/fsync/falloc）。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 18,
        "y": 71
      },
      "hiddenSeries": false,
      "id": 75,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": true,
        "hideZero": true,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  filetype AS metric,\n  AVG(open_count) AS open_iops\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_info, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND fileloc='pfs'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), filetype\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "PFS open iops",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "none",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，共享存储介质中的读操作在各类型文件上的IO带宽分布情况。\n\n\n指标来源&采集方式：\n- 通过polar_stat_io_info函数在每个进程类型维度上的IO信息累加得到上述指标。\n- polar_stat_io_info：对每个进程的io详细信息进行各个维度的展示。进程在什么类型的文件上（WAL/DATA/logindex）进行了什么操作（read/write）。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 80
      },
      "hiddenSeries": false,
      "id": 148,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  filetype AS metric,\n  AVG(read_throughput) AS read_throughput\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_info, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND fileloc='pfs'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), filetype\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "PFS read bps",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "decmbytes",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，共享存储介质中的写操作在各类型文件上的IO带宽分布情况。\n\n指标来源&采集方式：\n- 通过polar_stat_io_info函数在每个进程类型维度上的IO信息累加得到上述指标。\n- polar_stat_io_info：对每个进程的io详细信息进行各个维度的展示。进程在什么类型的文件上（WAL/DATA/logindex）进行了什么操作（read/write）。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 80
      },
      "hiddenSeries": false,
      "id": 149,
      "interval": "1s",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  filetype AS metric,\n  AVG(write_throughput) AS write_throughput\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_info, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND fileloc='pfs'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), filetype\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "PFS write bps",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1994",
          "format": "decmbytes",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:1995",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 89
      },
      "id": 88,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "数据库IO: 延迟",
      "type": "text"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，读操作延时情况，包括了共享存储介质与本地目录。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 1,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 0,
        "y": 90
      },
      "id": 76,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG((num_lessthan200us+0.00001) / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"[0, 200us]\",\n  AVG(num_lessthan400us / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(200us, 400us]\",\n  AVG(num_lessthan1ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(400us, 1ms]\",\n  AVG(num_lessthan10ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(1ms, 10ms]\",\n  AVG(num_lessthan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(10ms, 100ms]\",\n  AVG(num_morethan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(100ms, )\"\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_latency, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND iotype='read'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "read延迟分布",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，读操作延时情况，包括了共享存储介质与本地目录。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 1,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 6,
        "y": 90
      },
      "id": 77,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG((num_lessthan200us+0.00001) / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"[0, 200us]\",\n  AVG(num_lessthan400us / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(200us, 400us]\",\n  AVG(num_lessthan1ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(400us, 1ms]\",\n  AVG(num_lessthan10ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(1ms, 10ms]\",\n  AVG(num_lessthan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(10ms, 100ms]\",\n  AVG(num_morethan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(100ms, )\"\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_latency, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND iotype='write'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "write延迟分布",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，seek操作延时情况，包括了共享存储介质与本地目录。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 1,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 12,
        "y": 90
      },
      "id": 78,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG((num_lessthan200us+0.00001) / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"[0, 200us]\",\n  AVG(num_lessthan400us / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(200us, 400us]\",\n  AVG(num_lessthan1ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(400us, 1ms]\",\n  AVG(num_lessthan10ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(1ms, 10ms]\",\n  AVG(num_lessthan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(10ms, 100ms]\",\n  AVG(num_morethan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(100ms, )\"\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_latency, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND iotype='seek'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "seek延迟分布",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，open操作延时情况，包括了共享存储介质与本地目录。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 1,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 6,
        "x": 18,
        "y": 90
      },
      "id": 79,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG((num_lessthan200us+0.00001) / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"[0, 200us]\",\n  AVG(num_lessthan400us / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(200us, 400us]\",\n  AVG(num_lessthan1ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(400us, 1ms]\",\n  AVG(num_lessthan10ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(1ms, 10ms]\",\n  AVG(num_lessthan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(10ms, 100ms]\",\n  AVG(num_morethan100ms / (num_lessthan200us+num_lessthan400us+num_lessthan1ms+num_lessthan10ms+num_lessthan100ms+num_morethan100ms+0.00001)) AS \"(100ms, )\"\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_polar_stat_io_latency, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND iotype='open'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "open延迟分布",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 99
      },
      "id": 196,
      "panels": [],
      "title": "Resource - Space",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 100
      },
      "id": 124,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "磁盘空间",
      "type": "text"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "%"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 101
      },
      "id": 6,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(fs_blocks_usage) AS block使用率,\n  AVG(fs_inodes_usage) AS inode使用率\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "资源使用",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decmbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 101
      },
      "id": 5,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(polar_base_dir_size) AS 数据目录大小,\n  AVG(polar_wal_dir_size) AS WAL目录大小\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "空间分布",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 110
      },
      "id": 48,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "DB Metrics",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例的总连接数、活跃连接数、空闲连接数。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_activity视图。\n- 活跃连接数为当前state为active的条目数，空闲连接数为当前state为idle的条目数，总连接数为当前pg_stat_activity的总行数。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 111
      },
      "hiddenSeries": false,
      "id": 49,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(connections) AS total,\n  AVG(active_connections) AS active,\n  AVG(idle_connections) AS idle\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Connection",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例的活跃事务数和空闲事务数。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_activity视图。\n- 活跃事务数为当前state处在active的条目数，空闲连接数为当前state处在【'idle in transaction', 'idle in transaction (aborted)'】状态的条目数。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 111
      },
      "hiddenSeries": false,
      "id": 50,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(active_transactions) AS active,\n  AVG(idle_transactions) AS idle\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Transaction",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例的总提交数、总回滚数，TPS即为提交数与回滚数的总和。可反应数据库实例的运行状态。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_database视图，计算数据库提交、回滚数总和。\n- 提交数对应指标名称：xact_commit；回滚数对应指标名称：xact_rollback；TPS为二者之和。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 120
      },
      "hiddenSeries": false,
      "id": 3,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(commits_delta) AS commits,\n  AVG(rollbacks_delta) AS rollbacks,\n  AVG(commits_delta+rollbacks_delta) AS TPS\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "TPS",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2392",
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2393",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例tuple的读取&更新&删除情况。可反应数据库实例的运行状态，辅助判断数据库的性能。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_database视图，计算tuple相关指标，由于pg_stat_database视图的对应字段均为累积值，采集时会计算每秒差值.\n- pg_stat_database视图中对应字段含义（累积值）：tup_returned：自数据库启动以来通过查询返回的元组（行）数。tup_fetched：自数据库启动以来通过查询物理地从磁盘中提取的元组数。tup_inserted：自数据库启动以来插入的元组数。tup_updated：自数据库启动以来更新的元组数。tup_deleted：自数据库启动以来删除的元组数。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 120
      },
      "hiddenSeries": false,
      "id": 7,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(tup_returned_delta) AS tup_returned,\n  AVG(tup_fetched_delta) AS tup_fetched,\n  AVG(tup_inserted_delta) AS tup_inserted,\n  AVG(tup_updated_delta) AS tup_updated,\n  AVG(tup_deleted_delta) AS tup_deleted\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Rows",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 反应当前数据库的年龄，其大小与最老的冻结事务号有关，大的数据库年龄通常意味着长事务或vacuum不及时。当数据库年龄极大时（>12亿），会对数据库性能造成影响，且有事务号回卷的风险（>21亿）。\n\n指标来源&采集方式：\n- 指标来源于pg_database视图，计算每个数据库中的AGE(datfrozenxid)字段，并取最大的返回。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 0,
        "y": 129
      },
      "hiddenSeries": false,
      "id": 38,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(db_age) AS db_age\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "DB Age",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，最长的事务持续时间（采集时该事务依然处于活跃状态，并未完成提交或回滚），辅助判断当前数据库的长事务执行情况。长时间运行的事务可能会导致数据库年龄增加、wal日志膨胀、过时元组无法vacuum等问题。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_activity视图。\n- 采集方式：计算当前活跃的事务中最早开始的事务已经运行了多长时间，或者预备事务(prepared transactions)中最早的一个已经预备了多长时间，这个计算出的时间间隔被称作 swell_time。\n- 其中：最早开始的活跃事务仅当实际开始了事务会话的会话被考虑在内，预备事务是一部分两阶段提交协议（2PC），它们已经被预备提交但还没有最终提交或回滚的事务。\n- 原始采集sql：WITH a AS (SELECT MIN(xact_start) m FROM pg_stat_activity WHERE backend_type='client backend' AND (backend_xid IS NOT NULL OR backend_xmin IS NOT NULL)), b AS (SELECT MIN(prepared) m FROM pg_prepared_xacts) SELECT EXTRACT(EPOCH FROM NOW()-LEAST(a.m,b.m))::BIGINT FROM a,b",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 8,
        "y": 129
      },
      "id": 46,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(swell_time) AS 最长事务持续时间\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "最长事务持续时间",
      "type": "timeseries"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，最慢的一条SQL持续时间（采集时该条SQL依然处于正在执行状态，未执行完成），辅助判断当前数据库的SQL执行情况。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_activity视图，并通过backend_type='client backend' AND state='active'条件过滤元组。\n- 提取now() - query_start中最大的那条记录返回。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 16,
        "y": 129
      },
      "hiddenSeries": false,
      "id": 143,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(longest_sql_running_time) AS longest_sql_running_time\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "最慢SQL持续时间",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "ms",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，主库和各个与之建立流复制关系的实例或连接的复制延迟（包括了send延迟，write延迟，flush延迟，replay延迟），单位为MB，并标注每个流复制连接的名称。该指标仅从RW节点上采集。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_replication视图。\n- 采集方式：依照application_name为分组采集每条流复制的sent_lsn，write_lsn，flush_lsn，replay_lsn字段与RW节点的current_lsn()差距，分别作为发送延迟、写入延迟、刷盘延迟、回放延迟。\n- 其中：sent_lsn：RW发送到接收端的最后 WAL 日志位置（LSN）。write_lsn：流复制接收端确认已写入磁盘的最后 WAL 位置。flush_lsn：流复制接收端确认已刷盘（fsync）的最后 WAL 位置（PolarDB为derict IO，所以write_lsn之前的WAL日志其实都已经刷盘）。replay_lsn：流复制接收端确认已回放完成的最后 WAL 位置。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 13,
        "w": 12,
        "x": 0,
        "y": 138
      },
      "id": 144,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  application_name AS metric,\n  AVG(sent_latency_in_bytes) AS sent,\n  AVG(write_latency_in_bytes) AS write,\n  AVG(flush_latency_in_bytes) AS flush,\n  AVG(replay_latency_in_bytes) AS replay\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_pg_stat_replication, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND application_name NOT LIKE 'standby%'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), application_name\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "复制延迟 (bytes)",
      "type": "timeseries"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，主库和各个与之建立流复制关系的实例或连接的复制延迟（包括了write延迟，flush延迟，replay延迟），单位为ms，并标注每个流复制连接的名称。该指标仅从RW节点上采集。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_replication视图。\n- 采集方式：依照application_name为分组采集每条流复制的write_lag，flush_lag，replay_lag字段分别作为写入延迟、刷盘延迟、回放延迟。\n- 其中：write_lag为当前流复制接收端写入wal日志到操作系统相对其接受该wal日志时的延迟。flush_lag为当前流复制接收端将wal日志到刷盘fsync时相对其接受该wal日志时的延迟。replay_lag为当前流复制接收端将wal日志成功回放时相对其接受该wal日志时的延迟。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 13,
        "w": 12,
        "x": 12,
        "y": 138
      },
      "hiddenSeries": false,
      "id": 122,
      "interval": "1s",
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 1200,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  application_name AS metric,\n  AVG(replay_lag_in_ms) AS replay,\n  AVG(write_lag_in_ms) AS write,\n  AVG(flush_lag_in_ms) AS flush\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_pg_stat_replication, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}' AND application_name NOT LIKE 'standby%'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER), application_name\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "复制延迟 (时间)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "ms",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，数据库实例块在缓存与磁盘的读取次数信息，能够一定程度上反应数据库实例块读取状态和缓存命中率。\n- blks_read：当前时间窗口内从磁盘读取的块数。\n- blks_hit：当前时间窗口内在缓冲区缓存中命中的块数，无需磁盘 I/O。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_database视图。因pg_stat_database视图的blks_read和blks_hit字段为累积值，采集时会对视图中的累积值在指定时间窗口做差值，取得当前时段的指标状态。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 151
      },
      "id": 33,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(blks_read_delta) AS blks_read,\n  AVG(blks_hit_delta) AS blks_hit\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "DB Read",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，各进程将缓冲区中的脏页刷写到磁盘中的写入情况，单位为次数。包括了bg_writer进程、普通backend进程、checkpoint进程的刷脏情况。在PolarDB中，backend进程的刷脏次数统计了所有非bgwriter以及checkpoint进程的情况，例如并行刷脏、IOWorker等。该指标可反应数据库实例此时的刷脏在各进程中的分布情况。\n\n指标来源&采集方式：\n- 指标来源于pg_stat_bgwriter视图。pg_stat_bgwriter 是 PostgreSQL 数据库中的一个系统视图，它提供了有关后台写入进程（background writer process）的统计信息。\n- checkpoint：对应视图buffers_checkpoint列，在检查点期间写入磁盘的缓冲区数量。\n- bgwriter：对应视图buffers_clean列，后台写入进程在正常运行期间清理的脏页数量。\n- backend：对应视图buffers_backend列，其他进程的直接写入磁盘的缓冲区数量。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 151
      },
      "id": 34,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "8.1.2",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(buffers_checkpoint_delta) AS checkpoint,\n  AVG(buffers_backend_delta) AS backend,\n  AVG(buffers_clean_delta) AS bgwriter\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "DB Write",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 相关术语解释：WP：Write LSN，表示主库当前的WAL日志写入位点，可通过select pg_current_wal_insert_lsn();查询。CP：Consistent LSN，表示一致性位点，一致性位点之前的数据均已落盘，可通过select polar_consistent_lsn();查询。AP：Apply LSN，RO的回放位点，监控上获取的是所有RO中的最小回放位点，可通过select polar_oldest_apply_lsn();查询。\n- wp_cp_latency_mb: 当前的最新LSN与一致性位点的差距。若此值大可能意味着RW写入压力大或Checkpoint最近可能未成功执行。可结合RW当前压力状态和使用grep -nr 'Checkpoint approved' *error.log，查找错误日志中Checkpoint approved相关记录，确认在周期时间内Checkpoint是否正常执行了来分析原因。\n- ap_cp_latency_mb: 一致性位点与RO回放位点的差距。\n- wp_ap_latency_mb: 当前最新LSN与RO回放位点的差距。若此值大表示RO回放延迟大，可排查是否有非活跃复制槽。\n\n指标来源&采集方式：\n- wp_cp_latency_mb: pg_current_wal_insert_lsn(), polar_consistent_lsn())。\n- ap_cp_latency_mb: pg_wal_lsn_diff(polar_oldest_apply_lsn(), polar_consistent_lsn())。\n- wp_ap_latency_mb: pg_wal_lsn_diff(pg_current_wal_lsn(), polar_oldest_apply_lsn())。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decmbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 160
      },
      "id": 43,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(wp_cp_latency_mb) AS wp_cp_latency_mb,\n  AVG(ap_cp_latency_mb) AS ap_cp_latency_mb,\n  AVG(wp_ap_latency_mb) AS wp_ap_latency_mb\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "PolarDB 位点",
      "type": "timeseries"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 相关术语解释：Checkpoint位点，即为Checkpoint.redo点。原生逻辑Checkpoint执行时，Checkpoint.redo取值为当前的Write LSN，需等待该位点前的所有数据落盘。当PolarDB的lazy checkpoint功能开启时，Checkpoint.redo的取值为当前的一致性位点，Checkpoint能够无阻塞的快速执行完毕。\n- checkpoint位点延迟较大时，checkpoint位点直接影响集群Crash Recovey时回放的日志量，回放的日志量越多，耗时越长，对集群的可用性影响可能越大。\n\n以下几种情况可能导致checkpoint位点延迟：\n- 一致性位点延迟会导致checkpoint位点延迟，需要优先排查一致性位点延迟的原因。\n- 导致一致性位点延迟的原因均可能导致checkpoint位点延迟，例如业务中有批量数据修改或者刷脏不及时。\n- checkpoint执行周期较长，周期时间内有较多的数据修改。\n\n指标来源&采集方式：\n- select redo_lsn from pg_control_checkpoint();。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 160
      },
      "hiddenSeries": false,
      "id": 142,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(checkpoint_latency_mb) AS checkpoint延迟\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Checkpoint延迟",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "decmbytes",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 指标展示当前时间窗口上数据库实例的脏页数量，能够反应实例当前的更新写入压力情况。\n\n指标来源&采集方式：\n- 指标来源于polar_flushlist()函数。",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 169
      },
      "hiddenSeries": false,
      "id": 45,
      "interval": "1s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "maxDataPoints": 120,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(polar_dirtypage_size) AS polar_dirtypage_size\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "dirty page",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2478",
          "format": "none",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:2479",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 非活跃复制槽，当其数量大于0个时，需要重点关注，否则可能造成WAL日志堆积的风险。\n\n指标来源&采集方式：\n- select count(*) AS inactive_slots from pg_replication_slots where restart_lsn is not null and active = 'f';。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 169
      },
      "id": 151,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.2.10",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "${DataSource}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n  time - time % (($__interval_ms / 1000)::INTEGER) AS time,\n  AVG(inactive_slots) AS inactive_slots\nFROM polar_gawr_collection.get_data_from_proper_table(NULL::${LogicInstance}.view_fact_dbmetrics, $__unixEpochFrom(), $__unixEpochTo(), ($__interval_ms / 1000)::INTEGER)\nWHERE\n  physical_ins_name='${PhysicalInstance}'\nGROUP BY time - time % (($__interval_ms / 1000)::INTEGER)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Inactive slots",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 178
      },
      "id": 93,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "SQL & Transaction",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，已执行时间超过5s且还尚未执行完成的sql信息。展示包括进程pid、查询的dbname、该sql的等待事件类型和次数、执行时间、sql具体形式等信息。\n\n指标来源&采集方式：\n- 基于polar_stat_process等视图采集。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 1097
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 177
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "锁级别"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 42
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "锁类型"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 152
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "表"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 99
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 179
      },
      "id": 153,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "最大采样执行时间(分钟)"
          }
        ]
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n \nSELECT pid AS \"进程ID\", dbname AS \"数据库名称\", string_agg(wait_event || ':' || wait_event_count, ', ') AS \"等待事件及采样次数\", MAX(executing_time) / 60 AS \"最大采样执行时间(分钟)\", query AS \"查询\" FROM (\nSELECT\n                                   pid AS pid,\n                                   dbname AS dbname,\n                                   CASE WHEN wait_event_type ='' THEN 'CPU:CPU' ELSE wait_event_type || ':' || wait_event END AS wait_event,\n                                   query AS query,\n                                   COUNT(*) AS wait_event_count,\n                                   MAX(executing_time) AS executing_time\n                               FROM ${LogicInstance}.view_fact_polar_stat_slow_query\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY pid, dbname, CASE WHEN wait_event_type ='' THEN 'CPU:CPU' ELSE wait_event_type || ':' || wait_event END, query) a GROUP BY pid, dbname, query ORDER BY 3 DESC",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 慢查询",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内，锁的冲突情况。列举该锁所处的数据库、表、锁类型、锁级别，以及该锁被持有期间累计阻塞了多少个其他session的正常执行。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 1097
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 177
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "锁级别"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 42
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "锁类型"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 152
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "表"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 99
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 191
      },
      "id": 201,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   datname AS 数据库,\n                                   relation AS 表,\n                                   locktype AS 锁类型,\n                                   mode AS 锁级别,\n                                   query AS query,\n                                   SUM(total_num)::BIGINT AS 累计阻塞采样会话数\n                               FROM ${LogicInstance}.view_fact_polar_lock_contention_history\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY 数据库, 表, 锁类型, 锁级别, query\n                               ORDER BY 累计阻塞采样会话数 DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 锁阻塞情况",
      "type": "table"
    },
    {
      "datasource": {
        "type": "grafana-postgresql-datasource",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内事务持续时间最长的前10个事务（>5s），并提供它们的详细信息，包括有关应用、客户端、数据库、用户、进程、查询、状态和等待事件的数据。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 1097
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 177
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "锁级别"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 42
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "锁类型"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 152
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "表"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 99
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 203
      },
      "id": 202,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n WITH x AS (\nSELECT\n                                   time,\n                                   application_name,\n                                   client,\n                                   dbname,\n                                   username,\n                                   pid,\n                                   query,\n                                   state,\n                                   CASE WHEN wait_event_type='' THEN 'CPU:CPU' ELSE wait_event_type || ':' || wait_event END AS wait_event_union,\n                                   transaction_time AS transaction_time\n                               FROM ${LogicInstance}.view_fact_polar_stat_long_transaction\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               ) \nSELECT \n                                   TO_TIMESTAMP(time)::TEXT AS \"最后采样时间\",\n                                   x.application_name AS \"应用名称\",\n                                   x.client AS \"客户端\",\n                                   x.dbname AS \"数据库\",\n                                   x.username AS \"用户名\",\n                                   x.pid AS \"进程号\",\n                                   x.query AS \"上一条sql语句\",\n                                   x.state AS \"状态\",\n                                   x.wait_event_union AS \"等待事件\",\n                                   x.transaction_time AS \"事务持续时间\"\n                                   FROM x\n                               \n                               JOIN (\nSELECT\n                                   application_name,\n                                   client,\n                                   dbname,\n                                   username,\n                                   pid,\n                                   query,\n                                   state,\n                                   wait_event_union,\n                                   MAX(transaction_time) AS max_transaction_time\n                               FROM x\n                \n                               GROUP BY application_name, client, dbname, username, pid, query, state, wait_event_union\n                               ORDER BY max_transaction_time DESC LIMIT 10\n                               ) b ON x.application_name=b.application_name AND x.client=b.client AND x.dbname=b.dbname AND x.username=b.username AND x.pid=b.pid AND x.transaction_time=b.max_transaction_time",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top长事务 (>5s)",
      "type": "table"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 215
      },
      "id": 123,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "以下数据需要开启pg_stat_statements插件",
      "type": "text"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内累计执行时间较长的SQL详细信息。包括了累计执行时间、平均执行时间、IO占比、物理&逻辑读写，处理行数等信息。\n- 物理&逻辑解释：逻辑读表示读page操作被调用的次数，包括了缓存命中时从buffer中读取和未命中时从磁盘中读取的情况；而物理读表示从磁盘中读取的次数。逻辑写和物理写与前者类似。物理读写与逻辑读写的比例一定程度上表示了该SQL执行时的缓存命中率。\n\n指标来源&采集方式：\n- 从pg_stat_statements、pg_user、pg_database视图处理得到。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 997
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 177
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 216
      },
      "id": 115,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "累计执行时间(ms)"
          }
        ]
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n \n\n\n                               WITH x AS (\n                                      SELECT * FROM ${LogicInstance}.view_fact_polar_stat_top_sql\n                                      WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               )\n                               SELECT queryid AS queryid, query AS query,\n                                   \n                                   ROUND(SUM(total_time)::NUMERIC, 2) AS \"累计执行时间(ms)\",\n                                   SUM(calls)::BIGINT AS 执行次数,\n                                   ROUND((SUM(total_time) / SUM(calls))::NUMERIC, 2) AS \"平均执行时间(ms)\",\n                                   ROUND((SUM(blk_iotime) / SUM(total_time) * 100)::NUMERIC, 2) AS \"IO时间占比(%)\",\n                                   SUM(logical_read)::BIGINT AS 逻辑读,\n                                   SUM(blks_read)::BIGINT AS 物理读,\n                                   SUM(logical_write)::BIGINT AS 逻辑写,\n                                   SUM(blks_written)::BIGINT AS 物理写,\n                                   SUM(rows)::BIGINT AS 处理行数\n                               FROM x\n                               GROUP BY queryid, query\n                               ORDER BY SUM(total_time) DESC LIMIT 40",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 累计执行时间",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内平均执行时间较长的SQL详细信息。包括了累计执行时间、平均执行时间、IO占比、物理&逻辑读写，处理行数等信息。\n- 物理&逻辑解释：逻辑读表示读page操作被调用的次数，包括了缓存命中时从buffer中读取和未命中时从磁盘中读取的情况；而物理读表示从磁盘中读取的次数。逻辑写和物理写与前者类似。物理读写与逻辑读写的比例一定程度上表示了该SQL执行时的缓存命中率。\n\n指标来源&采集方式：\n- 从pg_stat_statements、pg_user、pg_database视图处理得到。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 884
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 228
      },
      "id": 83,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "累计执行时间(ms)"
          }
        ]
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n \n\n\n                               WITH x AS (\n                                      SELECT * FROM ${LogicInstance}.view_fact_polar_stat_top_sql\n                                      WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               )\n                               SELECT queryid, query,\n                                   ROUND(SUM(total_time)::NUMERIC, 2) AS \"累计执行时间(ms)\",\n                                   SUM(calls)::BIGINT AS 执行次数,\n                                   ROUND((SUM(total_time) / SUM(calls))::NUMERIC, 2) AS \"平均执行时间(ms)\",\n                                   ROUND((SUM(blk_iotime) / SUM(total_time) * 100)::NUMERIC, 2) AS \"IO时间占比(%)\",\n                                   SUM(logical_read)::BIGINT AS 逻辑读,\n                                   SUM(blks_read)::BIGINT AS 物理读,\n                                   SUM(logical_write)::BIGINT AS 逻辑写,\n                                   SUM(blks_written)::BIGINT AS 物理写,\n                                   SUM(rows)::BIGINT AS 处理行数\n                               FROM x\n                               GROUP BY queryid, query\n                               ORDER BY \"平均执行时间(ms)\" DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 平均执行时间",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内累计读IO耗时较长的SQL详细信息。包括了累计读IO时间、平均读IO时间、读缓存命中率等信息。\n\n指标来源&采集方式：\n- 从pg_stat_statements、pg_user、pg_database视图处理得到。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 1001
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 240
      },
      "id": 94,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n \n\n\n                               WITH x AS (\n                                      SELECT * FROM ${LogicInstance}.view_fact_polar_stat_top_sql\n                                      WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               )\n                               SELECT queryid, query,\n                                   ROUND(SUM(blk_read_time)::NUMERIC, 2) AS \"累计读IO时间(ms)\",\n                                   SUM(calls)::BIGINT AS 执行次数,\n                                   ROUND((SUM(total_time) / SUM(calls))::NUMERIC, 2) AS \"平均执行时间(ms)\",\n                                   ROUND((SUM(blk_read_time) / SUM(calls))::NUMERIC, 2) AS \"平均读IO时间(ms)\",\n                                   ROUND((SUM(blk_read_time) / SUM(total_time) * 100)::NUMERIC, 2) AS \"读IO耗时占比(%)\",\n                                   ROUND((SUM(logical_read) / SUM(calls))::NUMERIC, 2) AS 平均逻辑读,\n                                   ROUND((SUM(blks_read) / SUM(calls))::NUMERIC, 2) AS 平均物理读,\n                                   CASE WHEN SUM(logical_read) < 1 THEN 100 ELSE ROUND((SUM(blks_hit) / SUM(logical_read) * 100)::NUMERIC, 2) END AS \"读缓存命中率(%)\",\n                                   ROUND((SUM(rows) / SUM(calls))::NUMERIC, 2) AS 平均处理行数\n                               FROM x\n                               GROUP BY queryid, query\n                               ORDER BY SUM(blk_read_time) DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 读IO",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内累计写IO耗时较长的SQL详细信息。包括了累计写IO时间、平均写IO时间、写缓存命中率等信息。\n\n指标来源&采集方式：\n- 从pg_stat_statements、pg_user、pg_database视图处理得到。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 252
      },
      "id": 95,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "累计写IO时间(ms)"
          }
        ]
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n \n\n\n                               WITH x AS (\n                                      SELECT * FROM ${LogicInstance}.view_fact_polar_stat_top_sql\n                                      WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               )\n                               SELECT queryid, query,\n                                   ROUND(SUM(blk_write_time)::NUMERIC, 2) AS \"累计写IO时间(ms)\",\n                                   SUM(calls)::BIGINT AS 执行次数,\n                                   ROUND((SUM(total_time) / SUM(calls))::NUMERIC, 2) AS \"平均执行时间(ms)\",\n                                   ROUND((SUM(blk_write_time) / SUM(calls))::NUMERIC, 2) AS \"平均写IO时间(ms)\",\n                                   ROUND((SUM(blk_write_time) / SUM(total_time) * 100)::NUMERIC, 2) AS \"写IO耗时占比(%)\",\n                                   ROUND((SUM(logical_write) / SUM(calls))::NUMERIC, 2) AS 平均逻辑写,\n                                   ROUND((SUM(blks_written) / SUM(calls))::NUMERIC, 2) AS 平均物理写,\n                                   CASE WHEN SUM(logical_write) < 1 THEN 100 ELSE ROUND((SUM(blks_hit) / SUM(logical_write) * 100)::NUMERIC, 2) END AS \"写缓存命中率(%)\",\n                                   ROUND((SUM(rows) / SUM(calls))::NUMERIC, 2) AS 平均处理行数\n                               FROM x\n                               GROUP BY queryid, query\n                               ORDER BY SUM(blk_write_time) DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 写IO",
      "type": "table"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 264
      },
      "id": 97,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "Table & Index",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "description": "",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 265
      },
      "id": 101,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "         ",
        "mode": "markdown"
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "以下数据查询间隔建议放大至一小时以上",
      "type": "text"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内被执行顺序扫描次数较多的表。\n\n指标来源&采集方式：\n- 从pg_stat_user_tables视图中采集而来，根据字段seq_tup_read筛选。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 266
      },
      "id": 98,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n \n                               WITH x AS (\n                                   SELECT *\n                                   FROM ${LogicInstance}.view_fact_polar_stat_user_tables\n                                   WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               )\n                               SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   SUM(seq_scan)::BIGINT AS 顺序扫描次数,\n                                   SUM(seq_tup_read)::BIGINT AS 扫描行数\n                               FROM x\n                               GROUP BY dbname, schemaname, relname HAVING SUM(seq_tup_read) > 0.1\n                               ORDER BY 扫描行数 DESC LIMIT 10\n                               \n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 表级顺序扫描",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内被执行索引扫描次数较多的表。\n\n指标来源&采集方式：\n- 从pg_stat_user_tables视图中采集而来，根据字段idx_tup_fetch筛选。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 278
      },
      "id": 99,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n                                SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   SUM(idx_scan)::BIGINT AS 索引扫描次数,\n                                   SUM(idx_tup_fetch)::BIGINT AS 索引扫描行数\n                               FROM ${LogicInstance}.view_fact_polar_stat_user_tables\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY dbname, schemaname, relname HAVING SUM(idx_tup_fetch) > 0.1\n                               ORDER BY 索引扫描行数 DESC LIMIT 10\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 表级索引扫描",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内总变更行数较多的表。\n\n指标来源&采集方式：\n- 从pg_stat_user_tables视图中采集而来，根据字段n_tup_ins+n_tup_upd+n_tup_del+n_tup_hot_upd筛选。\n- n_tup_ins: 插入到表中的元组数量。\n- n_tup_upd: 更新的元组数量。\n- n_tup_hot_upd: 基于\"HOT\"更新的元组数量。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 290
      },
      "id": 100,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   SUM(n_tup_ins)::BIGINT AS 插入行数,\n                                   SUM(n_tup_upd)::BIGINT AS 更新行数,\n                                   SUM(n_tup_hot_upd)::BIGINT AS HOT更新行数,\n                                   SUM(n_tup_del)::BIGINT AS 删除行数,\n                                   SUM(n_tup_modified)::BIGINT AS 总变更行数\n                               FROM ${LogicInstance}.view_fact_polar_stat_user_tables\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY dbname, schemaname, relname HAVING SUM(n_tup_modified) > 0.1\n                               ORDER BY 总变更行数 DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 表级行数变更",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内被执行索引扫描次数较多的索引。\n\n指标来源&采集方式：\n- 从pg_stat_user_indexes视图中采集而来，根据字段idx_tup_read筛选。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 302
      },
      "id": 103,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   indexrelname AS 索引,\n                                   SUM(idx_scan)::BIGINT AS 扫描次数,\n                                   SUM(idx_tup_fetch)::BIGINT AS 返回行数,\n                                   SUM(idx_tup_read)::BIGINT AS 扫描行数\n                               FROM ${LogicInstance}.view_fact_polar_stat_user_indexes\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY 数据库, schema, 表, 索引 HAVING SUM(idx_tup_read) > 0.1\n                               ORDER BY 扫描行数 DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 索引级扫描",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内逻辑读次数较多的表。逻辑读：heap_blks_read+heap_blks_hit。\n\n指标来源&采集方式：\n- 从pg_statio_user_tables视图中采集而来，根据字段heap_blks_read+heap_blks_hit筛选。\n- heap_blks_read: 从磁盘上读取的表数据页（heap blocks）数量。\n- heap_blks_hit: 在缓存中找到，避免从磁盘读取的表数据页数量。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 314
      },
      "id": 104,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   SUM(heap_logical_read)::BIGINT AS 逻辑读,\n                                   SUM(heap_blks_read)::BIGINT AS 物理读,\n                                   ROUND((SUM(heap_blks_hit) / SUM(heap_logical_read) * 100)::NUMERIC, 2) AS \"缓存命中率(%)\"\n                               FROM ${LogicInstance}.view_fact_polar_statio_user_tables\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY 数据库, schema, 表 HAVING SUM(heap_logical_read) > 0.1\n                               ORDER BY 逻辑读 DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top表级读IO",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内使用索引的逻辑读次数较多的表。逻辑读：idx_blks_read+idx_blks_hit。\n\n指标来源&采集方式：\n- 从pg_statio_user_tables视图中采集而来，根据字段heap_blks_read+heap_blks_hit筛选。\n- heap_blks_read: 从磁盘上读取的表数据页（heap blocks）数量。\n- heap_blks_hit: 在缓存中找到，避免从磁盘读取的表数据页数量。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 326
      },
      "id": 105,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   SUM(idx_logical_read)::BIGINT AS 逻辑读,\n                                   SUM(idx_blks_read)::BIGINT AS 物理读,\n                                   ROUND((SUM(idx_blks_hit) / (SUM(idx_logical_read)+1) * 100)::NUMERIC, 2) AS \"缓存命中率(%)\"\n                               FROM ${LogicInstance}.view_fact_polar_statio_user_tables\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY 数据库, schema, 表 HAVING SUM(heap_logical_read) > 0.1\n                               ORDER BY 逻辑读 DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 表级索引读IO",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 展示当前时间窗口内索引页的逻辑读次数较多的索引。逻辑读：idx_blks_read+idx_blks_hit。\n\n指标来源&采集方式：\n- 从pg_statio_user_tables视图中采集而来，根据字段idx_blks_read+idx_blks_hitt筛选。\n- idx_blks_read: 从磁盘上读取的索引页数量。\n- idx_blks_hit: 在缓存中找到的索引页数量。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 338
      },
      "id": 106,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   indexrelname AS 索引,\n                                   SUM(idx_logical_read)::BIGINT AS 逻辑读,\n                                   SUM(idx_blks_read)::BIGINT AS 物理读,\n                                   ROUND((SUM(idx_blks_hit) / SUM(idx_logical_read) * 100)::NUMERIC, 2) AS \"缓存命中率(%)\"\n                               FROM ${LogicInstance}.view_fact_polar_statio_user_indexes\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}'\n                               GROUP BY 数据库, schema, 表, 索引 HAVING SUM(idx_logical_read) > 0.1\n                               ORDER BY 逻辑读 DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 索引级读IO",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 列举当前数据库实例空间占用最多的普通表或TOAST表。\n\n指标来源&采集方式：\n- pg_class视图，表大小计算：relpages * current_setting('block_size')::BIGINT / 1024 / 1024。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 350
      },
      "id": 107,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   CASE WHEN relkind='r' THEN '表'\n                                        WHEN relkind='i' THEN '索引'\n                                        WHEN relkind='S' THEN '序列'\n                                        WHEN relkind='t' THEN 'TOAST表'\n                                        ELSE '其它' END AS 类型,\n                                   ROUND(relsize_total::NUMERIC / 1024, 2) AS \"估计空间占用(GB)\"\n                               FROM ${LogicInstance}.view_fact_polar_stat_relation_size\n                               WHERE time = (SELECT MAX(time) FROM ${LogicInstance}.view_fact_polar_stat_relation_size WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}')\n                                   AND physical_ins_name='${PhysicalInstance}' AND relsize_total > 0.01\n                               ORDER BY relsize_total DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 空间占用",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 列举db_age较大的普通表或TOAST表，过大的db_age可能导致数据库回卷风险（>21亿）。若某表年龄持续超过12亿，此时已达到auto vacuum的freeze阈值，可能意味着auto vacuum一直无法成功对该表完成vacuum操作，建议手动执行vacuum freeze降低该表的年龄。\n\n指标来源&采集方式：\n- pg_class视图，表年龄计算：AGE(relfrozenxid)。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 362
      },
      "id": 108,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n                            SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   CASE WHEN relkind='r' THEN '表'\n                                        WHEN relkind='i' THEN '索引'\n                                        WHEN relkind='S' THEN '序列'\n                                        WHEN relkind='t' THEN 'TOAST表'\n                                        ELSE '其它' END AS 类型,\n                                   table_age::BIGINT AS value_年龄,\n                                   ROUND((table_age / 2147483647 * 100)::NUMERIC, 2) AS \"绕卷比例(%)\"\n                            FROM ${LogicInstance}.view_fact_polar_stat_table_age\n                            WHERE time = (SELECT MAX(time) FROM ${LogicInstance}.view_fact_polar_stat_table_age WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}')\n                            ORDER BY table_age DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 表年龄",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 列举当前死元组比例较多的表，较大的死元组比例可能意味着vacuum不及时，可根据上次vacuum和autovacuum时间辅助判断；必要时可手动执行vacuum操作。\n\n指标来源&采集方式：\n- pg_stat_user_tables视图，该视图的统计信息可以用来帮助判断何时需要索引优化、执行 VACUUM 或 ANALYZE 等维护任务。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 374
      },
      "id": 109,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   n_live_tup::BIGINT AS 活跃元组,\n                                   n_dead_tup::BIGINT AS 死亡元组,\n                                   ROUND(dead_tup_ratio::NUMERIC, 2) AS \"死亡元组比例(%)\",\n                                   CASE WHEN last_vacuum<0.1 THEN '未做过' ELSE ROUND(((time - last_vacuum) / 60)::NUMERIC, 1)::TEXT END AS \"距上次vacuum(分钟)\",\n                                   CASE WHEN last_autovacuum<0.1 THEN '未做过' ELSE ROUND(((time - last_autovacuum) / 60)::NUMERIC, 1)::TEXT END AS \"距上次autovacuum(分钟)\"\n                               FROM ${LogicInstance}.view_fact_polar_stat_user_tables\n                               WHERE time = (SELECT MAX(time) FROM ${LogicInstance}.view_fact_polar_stat_user_tables WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}')\n                                   AND physical_ins_name='${PhysicalInstance}'\n                               ORDER BY dead_tup_ratio DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top 膨胀率",
      "type": "table"
    },
    {
      "datasource": {
        "uid": "${DataSource}"
      },
      "description": "指标描述：\n- 列举在执行analyze后更新的行数较多的表。在analyze后更新的行数过多可能导致统计信息未来得及更新，可能影响sql执行时的最优执行计划选择。\n\n指标来源&采集方式：\n- pg_stat_user_tables视图，该视图的统计信息可以用来帮助判断何时需要索引优化、执行 VACUUM 或 ANALYZE 等维护任务。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 386
      },
      "id": 110,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n     SELECT\n                                   dbname AS 数据库,\n                                   schemaname AS schema,\n                                   relname AS 表,\n                                   n_mod_since_analyze::BIGINT AS analyze后更新行数,\n                                   CASE WHEN last_analyze<0.1 THEN '未做过' ELSE ROUND(((time - last_analyze) / 60)::NUMERIC, 1)::TEXT END AS \"距上次analyze(分钟)\\\",\n                                   CASE WHEN last_autoanalyze<0.1 THEN '未做过' ELSE ROUND(((time - last_autoanalyze) / 60)::NUMERIC, 1)::TEXT END AS \"距上次autoanalyze(分钟)\"\n                            FROM ${LogicInstance}.view_fact_polar_stat_user_tables\n                            WHERE time = (SELECT MAX(time) FROM ${LogicInstance}.view_fact_polar_stat_user_tables WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}')\n                            ORDER BY n_mod_since_analyze DESC LIMIT 10",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Top analyze后更新行数",
      "type": "table"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "postgres",
        "uid": "TNySO97nz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 398
      },
      "id": 112,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "TNySO97nz"
          },
          "refId": "A"
        }
      ],
      "title": "Configuration",
      "type": "row"
    },
    {
      "datasource": {
        "type": "grafana-postgresql-datasource",
        "uid": "${DataSource}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 14,
        "w": 24,
        "x": 0,
        "y": 399
      },
      "id": 113,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT name AS 名称, source AS 来源, MAX(setting) AS 值, (TO_TIMESTAMP(MAX(time)))::TEXT AS 采集时间\n                               FROM ${LogicInstance}.view_fact_polar_settings\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}' AND source NOT IN ('client', 'session')\n                               GROUP BY name, source\n                               ORDER BY\n                                   CASE source\n                                          WHEN 'configuration file' THEN 1\n                                          WHEN 'override' THEN 2\n                                          WHEN 'default' THEN 3\n                                          ELSE 4 END",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "数据库配置",
      "type": "table"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DataSource}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "query"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 340
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "queryid"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 176
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 14,
        "w": 24,
        "x": 0,
        "y": 413
      },
      "id": 188,
      "interval": "1s",
      "maxDataPoints": 120,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.4.1",
      "targets": [
        {
          "constant": 6.5,
          "datasource": {
            "uid": "${DataSource}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "/* rds internal mark */\n SELECT name AS 名称, source AS 来源, MAX(setting) AS 值1, MIN(setting) AS 值2 \n                               FROM ${LogicInstance}.view_fact_polar_settings\n                               WHERE time BETWEEN $__unixEpochFrom() AND $__unixEpochTo() AND physical_ins_name='${PhysicalInstance}' AND source NOT IN ('client', 'session')\n                               GROUP BY name, source\n                               HAVING MAX(setting) != MIN(setting)\n                               ORDER BY\n                                   CASE source\n                                          WHEN 'configuration file' THEN 1\n                                          WHEN 'override' THEN 2\n                                          WHEN 'default' THEN 3\n                                          ELSE 4 END",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "数据库配置变化",
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 39,
  "tags": [
    "PolarDB",
    "GAWR"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": true,
          "text": "grafana-postgresql-datasource",
          "value": "ddi6ps317uku8b"
        },
        "hide": 0,
        "includeAll": false,
        "label": "数据源",
        "multi": false,
        "name": "DataSource",
        "options": [],
        "query": "postgres",
        "queryValue": "",
        "refresh": 1,
        "regex": "/^((?!default).)*$/",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {
          "selected": false,
          "text": "pc-bp1xxx",
          "value": "pc-bp1xxx"
        },
        "datasource": {
          "type": "postgres",
          "uid": "${DataSource}"
        },
        "definition": "SELECT  logical_ins_name FROM $LogicInstance.dim_ins_info  WHERE logical_ins_name != 'others'",
        "hide": 0,
        "includeAll": false,
        "label": "逻辑实例ID",
        "multi": false,
        "name": "LogicInstanceShow",
        "options": [],
        "query": "/* rds internal mark */\n SELECT  logical_ins_name FROM $LogicInstance.dim_ins_info  WHERE logical_ins_name != 'others'",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "pi-bp1x9vk290051t9u0",
          "value": "pi-bp1x9vk290051t9u0"
        },
        "datasource": {
          "type": "postgres",
          "uid": "${DataSource}"
        },
        "definition": "SELECT  physical_ins_name FROM $LogicInstance.dim_ins_info  WHERE physical_ins_name != 'others'",
        "hide": 0,
        "includeAll": false,
        "label": "物理实例ID",
        "multi": false,
        "name": "PhysicalInstance",
        "options": [],
        "query": "/* rds internal mark */\n SELECT  physical_ins_name FROM $LogicInstance.dim_ins_info  WHERE physical_ins_name != 'others'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "polar_gawr_collection",
          "value": "polar_gawr_collection"
        },
        "datasource": {
          "type": "postgres",
          "uid": "${DataSource}"
        },
        "definition": "SELECT 'polar_gawr_collection'",
        "hide": 2,
        "includeAll": false,
        "label": "逻辑实例id",
        "multi": false,
        "name": "LogicInstance",
        "options": [],
        "query": "/* rds internal mark */\n SELECT 'polar_gawr_collection'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "to": "now"
  },
  "timepicker": {
    "hidden": false
  },
  "timezone": "",
  "title": "PolarDB Global AWR",
  "uid": "ForCustom",
  "version": 5,
  "weekStart": ""
}