{
    "annotations": {
        "list": [
            {
                "builtIn": 1,
                "datasource": "-- Grafana --",
                "enable": true,
                "hide": true,
                "iconColor": "rgba(0, 211, 255, 1)",
                "name": "Annotations & Alerts",
                "type": "dashboard"
            }
        ]
    },
    "editable": true,
    "gnetId": null,
    "graphTooltip": 0,
    "id": 27,
    "iteration": 1657190288914,
    "links": [],
    "panels": [
        {
            "collapsed": false,
            "datasource": null,
            "gridPos": {
                "h": 1,
                "w": 24,
                "x": 0,
                "y": 0
            },
            "id": 6,
            "panels": [],
            "title": "Fast Disk",
            "type": "row"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    }
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 1
            },
            "id": 20,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "sum(kube_node_status_allocatable{resource=\"test_infra_pingcap_net_fast_disks\"} and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(node) available_node)",
                    "interval": "",
                    "legendFormat": "max allocatable",
                    "refId": "A"
                },
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"test_infra_pingcap_net_fast_disks\"} and on(node) kube_node_labels{label_resourcepool=\"$resource_pool\"} unless on(namespace) living_testbed)",
                    "hide": true,
                    "interval": "",
                    "legendFormat": "non testbed requested",
                    "refId": "B"
                },
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"test_infra_pingcap_net_fast_disks\"} and on(node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(namespace) living_testbed)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "testbed requested",
                    "refId": "C"
                }
            ],
            "title": "Resource Pool Fast Disk",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    }
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 1
            },
            "id": 22,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "sum by(node) (kube_node_status_allocatable{resource=\"test_infra_pingcap_net_fast_disks\"} and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"}) - \nsum by (node) (kube_pod_container_resource_requests{resource=\"test_infra_pingcap_net_fast_disks\"}) and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"}",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "{{node}}",
                    "refId": "A"
                }
            ],
            "title": "Node Fast Disk Free",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    }
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 9
            },
            "id": 24,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"test_infra_pingcap_net_fast_disks\"} and on(namespace) living_testbed and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(node) available_node) by (namespace)",
                    "interval": "",
                    "legendFormat": "{{namespace}}",
                    "refId": "A"
                }
            ],
            "title": "Testbed Fast Disk Request",
            "type": "timeseries"
        },
        {
            "collapsed": false,
            "datasource": null,
            "gridPos": {
                "h": 1,
                "w": 24,
                "x": 0,
                "y": 17
            },
            "id": 2,
            "panels": [],
            "title": "CPU",
            "type": "row"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    }
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 18
            },
            "id": 8,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "0.8 * sum(kube_node_status_allocatable{resource=\"cpu\"} and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(node) available_node)",
                    "interval": "",
                    "legendFormat": "max allocatable",
                    "refId": "A"
                },
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\"} and on(node) kube_node_labels{label_resourcepool=\"$resource_pool\"} unless on(namespace) living_testbed)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "non testbed requested",
                    "refId": "B"
                },
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\"} and on(node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(namespace) living_testbed)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "testbed requested",
                    "refId": "C"
                }
            ],
            "title": "Resource Pool CPU",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    }
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 18
            },
            "id": 15,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "node_cpu_free and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"}",
                    "interval": "",
                    "legendFormat": "{{node}}",
                    "refId": "A"
                }
            ],
            "title": "Node CPU Free(cores)",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    }
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 26
            },
            "id": 11,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\"} and on(namespace) living_testbed and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(node) available_node) by (namespace)",
                    "interval": "",
                    "legendFormat": "{{namespace}}",
                    "refId": "A"
                }
            ],
            "title": "Testbed CPU Request",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    },
                    "unit": "percentunit"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 26
            },
            "id": 17,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "label_replace(instance:node_cpu:ratio, \"node\", \"$1\", \"instance\", \"(.*):.*\") and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"}",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "{{node}}",
                    "refId": "A"
                }
            ],
            "title": "Node CPU Actual Usage",
            "type": "timeseries"
        },
        {
            "collapsed": false,
            "datasource": null,
            "gridPos": {
                "h": 1,
                "w": 24,
                "x": 0,
                "y": 34
            },
            "id": 4,
            "panels": [],
            "title": "Memory",
            "type": "row"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    },
                    "unit": "bytes"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 35
            },
            "id": 9,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "0.8 * sum(kube_node_status_allocatable{resource=\"memory\"} and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(node) available_node)",
                    "interval": "",
                    "legendFormat": "max allocatable",
                    "refId": "A"
                },
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\"} and on(node) kube_node_labels{label_resourcepool=\"$resource_pool\"} unless on(namespace) living_testbed)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "non testbed requested",
                    "refId": "B"
                },
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\"} and on(node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(namespace) living_testbed)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "testbed requested",
                    "refId": "C"
                }
            ],
            "title": "Resource Pool Memory",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    },
                    "unit": "bytes"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 35
            },
            "id": 18,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "node_mem_free and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"}",
                    "interval": "",
                    "legendFormat": "{{node}}",
                    "refId": "A"
                }
            ],
            "title": "Node Memory Free",
            "type": "timeseries"
        },
        {
            "datasource": "${prometheus}",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "palette-classic"
                    },
                    "custom": {
                        "axisLabel": "",
                        "axisPlacement": "auto",
                        "barAlignment": 0,
                        "drawStyle": "line",
                        "fillOpacity": 0,
                        "gradientMode": "none",
                        "hideFrom": {
                            "legend": false,
                            "tooltip": false,
                            "viz": false
                        },
                        "lineInterpolation": "linear",
                        "lineWidth": 1,
                        "pointSize": 5,
                        "scaleDistribution": {
                            "type": "linear"
                        },
                        "showPoints": "auto",
                        "spanNulls": false,
                        "stacking": {
                            "group": "A",
                            "mode": "none"
                        },
                        "thresholdsStyle": {
                            "mode": "off"
                        }
                    },
                    "mappings": [],
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            },
                            {
                                "color": "red",
                                "value": 80
                            }
                        ]
                    },
                    "unit": "bytes"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 43
            },
            "id": 13,
            "options": {
                "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                },
                "tooltip": {
                    "mode": "single"
                }
            },
            "targets": [
                {
                    "exemplar": true,
                    "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\"} and on(namespace) living_testbed and on (node) kube_node_labels{label_resourcepool=\"$resource_pool\"} and on(node) available_node) by (namespace)",
                    "interval": "",
                    "legendFormat": "{{namespace}}",
                    "refId": "A"
                }
            ],
            "title": "Testbed Memory",
            "type": "timeseries"
        }
    ],
    "schemaVersion": 30,
    "style": "dark",
    "tags": ["test-infra"],
    "templating": {
        "list": [
            {
                "current": {
                    "selected": false,
                    "text": "test-infra-prod",
                    "value": "test-infra-prod"
                },
                "description": null,
                "error": null,
                "hide": 0,
                "includeAll": false,
                "label": null,
                "multi": false,
                "name": "prometheus",
                "options": [],
                "query": "prometheus",
                "queryValue": "",
                "refresh": 1,
                "regex": "",
                "skipUrlSync": false,
                "type": "datasource"
            },
            {
                "allValue": null,
                "current": {
                    "selected": true,
                    "text": "default",
                    "value": "default"
                },
                "datasource": "${prometheus}",
                "definition": "label_values(kube_node_labels, label_resourcepool)",
                "description": null,
                "error": null,
                "hide": 0,
                "includeAll": false,
                "label": null,
                "multi": false,
                "name": "resource_pool",
                "options": [],
                "query": {
                    "query": "label_values(kube_node_labels, label_resourcepool)",
                    "refId": "StandardVariableQuery"
                },
                "refresh": 1,
                "regex": "",
                "skipUrlSync": false,
                "sort": 0,
                "type": "query"
            }
        ]
    },
    "time": {
        "from": "now-6h",
        "to": "now"
    },
    "timepicker": {},
    "timezone": "",
    "title": "Resource Pool",
    "uid": "_pYXL267k",
    "version": 6
}
