Grafana dashboard: ModelArts-Cluster-View

华为云ModelArts服务提供的集群视图模板，主要分为4个部分：
- Overview：展示集群的统计信息(节点数，运行的任务数)和GPU/NPU卡的简略使用信息(如卡的分配率和利用率等信息)；  
- 节点信息：以表格形式展示了每个节点的卡分类和使用情况，以及CPU和MEMORY的利用率信息；  
- 关键任务分析：主要展示用户的大任务和低效任务的信息；  
- 用户信息：展示每个用户对GPU/NPU卡的使用情况。

{
  "__inputs": [
    {
      "name": "DS_CN-NORTH-9_MAIN",
      "label": "cn-north-9_main",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.1.7"
    },
    {
      "type": "panel",
      "id": "piechart",
      "name": "Pie chart",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 60,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 26,
      "panels": [],
      "title": "Overview",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "最近两分钟运行的任务总数",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 0,
        "y": 1
      },
      "hideTimeOverride": true,
      "id": 2,
      "maxDataPoints": 99999,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(count by(service_id) (ma_container_gpu_util{pool_id=\"$pool_id\"})) OR count(count by(service_id) (ma_container_npu_util{pool_id=\"$pool_id\"})) OR vector(0)",
          "legendFormat": "",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "2m",
      "title": "运行中任务数",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 2,
        "y": 1
      },
      "hideTimeOverride": true,
      "id": 3,
      "maxDataPoints": 99999,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(ma_node_cpu_util{pool_id=\"$pool_id\"})",
          "legendFormat": "",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "5m",
      "title": "节点数",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "展示当前有几个用户在集群中运行任务",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 4,
        "y": 1
      },
      "hideTimeOverride": true,
      "id": 33,
      "maxDataPoints": 99999,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(count by(user_id) (ma_container_gpu_util{pool_id=\"$pool_id\"})) OR count(count by(user_id) (ma_container_npu_util{pool_id=\"$pool_id\"})) OR vector(0)",
          "legendFormat": "",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "2m",
      "title": "用户数",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "实时展示卡的分配情况。分配数是指有多少张卡被任务占用了",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "卡分配率"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 1
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "percentage",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 6,
        "y": 1
      },
      "hideTimeOverride": false,
      "id": 5,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "max"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(ma_node_gpu_util{pool_id=\"$pool_id\"}) OR count(ma_node_npu_util{pool_id=\"$pool_id\"}) OR vector(0)",
          "legendFormat": "总卡数",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(ma_container_gpu_util{pool_id=\"$pool_id\"}) OR count(ma_container_npu_util{pool_id=\"$pool_id\"}) OR vector(0)",
          "hide": false,
          "legendFormat": "分配数",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count(ma_container_gpu_util{pool_id=\"$pool_id\"}) / count(ma_node_gpu_util{pool_id=\"$pool_id\"})) OR (count(ma_container_npu_util{pool_id=\"$pool_id\"}) / count(ma_node_npu_util{pool_id=\"$pool_id\"})) OR vector(0)",
          "hide": false,
          "legendFormat": "卡分配率",
          "range": true,
          "refId": "C"
        }
      ],
      "timeFrom": "2m",
      "title": "卡分配情况",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "实时展示卡的使用情况",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "max": 100,
          "min": 0,
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "yellow",
                "value": 50
              },
              {
                "color": "green",
                "value": 85
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 12,
        "y": 1
      },
      "hideTimeOverride": false,
      "id": 32,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_node_gpu_util{pool_id=\"$pool_id\"}) OR avg(ma_node_npu_util{pool_id=\"$pool_id\"}) OR vector(0)",
          "legendFormat": "卡平均利用率",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_node_gpu_mem_util{pool_id=\"$pool_id\"}) OR avg(ma_node_npu_memory_util{pool_id=\"$pool_id\"}) OR vector(0)",
          "hide": false,
          "legendFormat": "卡显存平均利用率",
          "range": true,
          "refId": "B"
        }
      ],
      "timeFrom": "2m",
      "title": "卡使用情况",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "实时展示集群整体的CPU和MEMORY使用情况",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "CPU平均利用率"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "内存总量"
            },
            "properties": [
              {
                "id": "unit",
                "value": "decmbytes"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "内存平均利用率"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 4,
        "w": 8,
        "x": 16,
        "y": 1
      },
      "hideTimeOverride": false,
      "id": 7,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "max"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "builder",
          "expr": "sum(ma_node_cpu_limit_core{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "CPU核数",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "builder",
          "expr": "avg(ma_node_cpu_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "CPU平均利用率",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "builder",
          "expr": "sum(ma_node_memory_total_megabytes{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "内存总量",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "builder",
          "expr": "avg(ma_node_memory_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "内存平均利用率",
          "range": true,
          "refId": "D"
        }
      ],
      "timeFrom": "2m",
      "title": "CPU&内存",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 0,
        "y": 5
      },
      "id": 19,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(ma_container_gpu_util{pool_id=\"$pool_id\"}) OR count(ma_container_npu_util{pool_id=\"$pool_id\"})",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "卡分配数",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": [],
          "max": 1,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 6,
        "y": 5
      },
      "id": 20,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(ma_container_gpu_util{pool_id=\"$pool_id\"}) / count(ma_node_gpu_util{pool_id=\"$pool_id\"})",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count(ma_container_npu_util{pool_id=\"$pool_id\"}) / count(ma_node_npu_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "卡分配率",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 12,
        "y": 5
      },
      "id": 17,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_node_gpu_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "整体GPU平均利用率",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_container_gpu_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "运行中任务GPU平均利用率",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_node_npu_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "整体NPU平均利用率",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_container_npu_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "运行中任务NPU平均利用率",
          "range": true,
          "refId": "D"
        }
      ],
      "title": "卡利用率",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 18,
        "y": 5
      },
      "id": 18,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_node_gpu_mem_util{pool_id=\"$pool_id\"})",
          "legendFormat": "整体GPU显存平均利用率",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_container_gpu_mem_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "运行中任务GPU显存平均利用率",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_node_npu_memory_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "整体NPU显存平均利用率",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg(ma_container_npu_memory_util{pool_id=\"$pool_id\"})",
          "hide": false,
          "legendFormat": "运行中任务NPU显存平均利用率",
          "range": true,
          "refId": "D"
        }
      ],
      "title": "卡显存利用率",
      "type": "timeseries"
    },
    {
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 11
      },
      "id": 15,
      "title": "节点信息",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "展示有GPU或NPU卡的节点的相关信息",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "center",
            "displayMode": "auto",
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "node_ip"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "节点ip"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "host_name"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "节点名称"
              },
              {
                "id": "links",
                "value": [
                  {
                    "title": "",
                    "url": "/d/iDCdZxY4k/modelarts-node-view?orgId=1&refresh=15m&${data_source:queryparam}&${pool_id:queryparam}&var-node_ip=${__data.fields.node_ip}&var-node_name=${__data.fields.host_name}&from=${__from}$&to=${__to}"
                  }
                ]
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #A (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "总卡数"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #B (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "分配卡数"
              },
              {
                "id": "noValue",
                "value": "0"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #C (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "任务数"
              },
              {
                "id": "noValue",
                "value": "0"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #D (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "GPU平均利用率"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "custom.displayMode",
                "value": "lcd-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              },
              {
                "id": "decimals",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #E (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "GPU显存平均利用率"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "custom.displayMode",
                "value": "lcd-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              },
              {
                "id": "decimals",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #F (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "NPU平均利用率"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              },
              {
                "id": "custom.displayMode",
                "value": "lcd-gauge"
              },
              {
                "id": "decimals",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #G (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "NPU显存平均利用率"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "custom.displayMode",
                "value": "lcd-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              },
              {
                "id": "decimals",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #H (mean)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "CPU核数"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #I (lastNotNull)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "CPU利用率"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "custom.displayMode",
                "value": "lcd-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              },
              {
                "id": "decimals",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #J (mean)"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "内存总量"
              },
              {
                "id": "unit",
                "value": "decmbytes"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #K (lastNotNull)"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "min",
                "value": 0
              },
              {
                "id": "max",
                "value": 100
              },
              {
                "id": "displayName",
                "value": "内存利用率"
              },
              {
                "id": "custom.displayMode",
                "value": "lcd-gauge"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 50
                    },
                    {
                      "color": "green",
                      "value": 85
                    }
                  ]
                }
              },
              {
                "id": "decimals",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "总卡数"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 150
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "分配卡数"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 142
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "任务数"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 133
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "id": 9,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count by(node_ip, host_name) (ma_node_gpu_util{pool_id=\"$pool_id\"})) OR (count by(node_ip, host_name) (ma_node_npu_util{pool_id=\"$pool_id\"}))",
          "format": "table",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count by(node_ip) (ma_container_gpu_util{pool_id=\"$pool_id\"})) OR (count by(node_ip) (ma_container_npu_util{pool_id=\"$pool_id\"}))",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count by(node_ip) (count by(node_ip, service_id) (ma_container_gpu_util{pool_id=\"$pool_id\"}))) OR (count by(node_ip) (count by(node_ip, service_id) (ma_container_npu_util{pool_id=\"$pool_id\"})))",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg by(node_ip) (ma_node_gpu_util{pool_id=\"$pool_id\"})",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg by(node_ip) (ma_node_gpu_mem_util{pool_id=\"$pool_id\"})",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "E"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg by(node_ip) (ma_node_npu_util{pool_id=\"$pool_id\"})",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "F"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "avg by(node_ip) (ma_node_npu_memory_util{pool_id=\"$pool_id\"})",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "G"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "ma_node_cpu_limit_core{pool_id=\"$pool_id\"}",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "H"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "ma_node_cpu_util{pool_id=\"$pool_id\"}",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "I"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "ma_node_memory_total_megabytes{pool_id=\"$pool_id\"}",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "J"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "ma_node_memory_util{pool_id=\"$pool_id\"}",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "K"
        }
      ],
      "timeFrom": "2m",
      "title": "节点信息",
      "transformations": [
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Value": {
                "aggregations": [
                  "mean"
                ],
                "operation": "aggregate"
              },
              "Value #A": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #B": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #C": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #D": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #E": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #F": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #G": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #H": {
                "aggregations": [
                  "mean"
                ],
                "operation": "aggregate"
              },
              "Value #I": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "Value #J": {
                "aggregations": [
                  "mean"
                ],
                "operation": "aggregate"
              },
              "Value #K": {
                "aggregations": [
                  "lastNotNull"
                ],
                "operation": "aggregate"
              },
              "host_name": {
                "aggregations": [],
                "operation": "groupby"
              },
              "node_ip": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "desc": true,
                "field": "Value #D (lastNotNull)"
              }
            ]
          }
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "desc": true,
                "field": "Value #F (lastNotNull)"
              }
            ]
          }
        }
      ],
      "type": "table"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 21
      },
      "id": 13,
      "panels": [],
      "title": "关键任务分析",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "数据单位是卡时，即卡数乘以小时数，可以理解为某个任务使用一张卡运行的小时数。32卡*36h以上任务，即累计值大于1152的（时间段需要设置在7天内）可以认为是大任务。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "links": [
            {
              "title": "",
              "url": "/d/-b1bPyL4k/modelarts-task-view?orgId=1&${data_source:queryparam}&var-service_id=${__field.labels.service_id}&from=${__from}&to=${__to}"
            }
          ],
          "mappings": [],
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "unit",
                "value": "卡时"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 8,
        "x": 0,
        "y": 22
      },
      "id": 22,
      "interval": "10m",
      "maxDataPoints": 1024,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "sortBy": "Value",
          "sortDesc": false,
          "values": [
            "value"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count by(service_id)(ma_container_gpu_util{pool_id=\"$pool_id\"}))/6 OR (count by(service_id)(ma_container_npu_util{pool_id=\"$pool_id\"}))/6",
          "format": "time_series",
          "interval": "",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "7d",
      "title": "任务占用卡时",
      "transformations": [],
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "任务的GPU平均利用率在某个时刻低于50%时，认为该时刻为低效时刻。低效时刻累计超过1h的任务，认为是低效任务（时间段需要设置在7天内）。",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "links": [
            {
              "title": "",
              "url": "/d/-b1bPyL4k/modelarts-task-view?orgId=1&${data_source:queryparam}&var-service_id=${__field.labels.service_id}&from=${__from}&to=${__to}"
            }
          ],
          "mappings": [],
          "unit": "m"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 8,
        "x": 8,
        "y": 22
      },
      "id": 23,
      "interval": "1m",
      "maxDataPoints": 10080,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "values": [
            "value"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "count"
          ],
          "fields": "",
          "values": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(avg by(service_id)(ma_container_gpu_util{pool_id=\"$pool_id\"}) < 50) OR (avg by(service_id)(ma_container_npu_util{pool_id=\"$pool_id\"}) < 50)",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "7d",
      "title": "任务低效部分占用时长",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "description": "GPU平均利用率低于50%任务的占用的卡时（每分钟统计1次）",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 25,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "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": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "unit",
                "value": "卡时"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 8,
        "x": 16,
        "y": 22
      },
      "id": 24,
      "interval": "1m",
      "maxDataPoints": 999999,
      "options": {
        "legend": {
          "calcs": [
            "sum"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count((ma_container_gpu_util{pool_id=\"$pool_id\"}) < 50) / 60) OR (count((ma_container_npu_util{pool_id=\"$pool_id\"}) < 50) / 60)",
          "legendFormat": "low_gpu_task_time",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "7d",
      "title": "低效任务占用卡时",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 29
      },
      "id": 11,
      "panels": [],
      "title": "用户信息",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "links": [
            {
              "title": "",
              "url": "/d/8QcY6pLVk/modelarts-user-view?orgId=1&${data_source:queryparam}&${pool_id:queryparam}&var-user_id=${__field.labels.user_id}&from=${__from}&to=${__to}"
            }
          ],
          "mappings": []
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 8,
        "x": 0,
        "y": 30
      },
      "hideTimeOverride": false,
      "id": 28,
      "maxDataPoints": 99999,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "values": [
            "value"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(count by(user_id) (ma_container_gpu_util{pool_id=\"$pool_id\"})) OR (count by(user_id) (ma_container_npu_util{pool_id=\"$pool_id\"}))",
          "legendFormat": "user: {{user_id}}",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": "2m",
      "title": "各用户实时分配卡数",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "links": [
            {
              "title": "",
              "url": "/d/8QcY6pLVk/modelarts-user-view?orgId=1&${data_source:queryparam}&${pool_id:queryparam}&var-user_id=${__field.labels.user_id}&from=${__from}&to=${__to}"
            }
          ],
          "mappings": []
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 8,
        "x": 8,
        "y": 30
      },
      "id": 29,
      "maxDataPoints": 99999,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "values": [
            "value"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count by(user_id) (count by(user_id, service_id) (ma_container_gpu_util{pool_id=\"$pool_id\"}))",
          "format": "time_series",
          "legendFormat": "user: {{user_id}}",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "count by(user_id) (count by(user_id, service_id) (ma_container_npu_util{pool_id=\"$pool_id\"}))",
          "format": "time_series",
          "hide": false,
          "legendFormat": "user: {{user_id}}",
          "range": true,
          "refId": "B"
        }
      ],
      "timeFrom": "2m",
      "title": "各用户实时任务数",
      "transformations": [],
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 8,
        "x": 16,
        "y": 30
      },
      "id": 30,
      "maxDataPoints": 99999,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.1.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "(avg by(user_id) (ma_container_gpu_util{pool_id=\"$pool_id\"})) OR (avg by(user_id) (ma_container_npu_util{pool_id=\"$pool_id\"}))",
          "format": "time_series",
          "legendFormat": "user: {{user_id}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "各用户平均卡利用率",
      "transformations": [],
      "type": "timeseries"
    }
  ],
  "refresh": "15m",
  "schemaVersion": 37,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "cn-north-9_main",
          "value": "cn-north-9_main"
        },
        "hide": 0,
        "includeAll": false,
        "label": "data_source",
        "multi": false,
        "name": "data_source",
        "options": [],
        "query": "prometheus",
        "queryValue": "",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {
          "selected": false,
          "text": "os-train-d910-noah-0bfc7d3b168026e02f77c001ac3d8e18",
          "value": "os-train-d910-noah-0bfc7d3b168026e02f77c001ac3d8e18"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${data_source}"
        },
        "definition": "ma_node_cpu_limit_core",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "pool_id",
        "options": [],
        "query": {
          "query": "ma_node_cpu_limit_core",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "/.*pool_id=\"([^\"]*).*/",
        "skipUrlSync": false,
        "sort": 1,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "ModelArts-Cluster-View",
  "uid": "dJXLSsY4z",
  "version": 52,
  "weekStart": "",
  "gnetId": 18582
}