Help Center/ ModelArts/ API Reference/ Resource Management/ Monitoring a Resource Pool
Updated on 2024-05-30 GMT+08:00

Monitoring a Resource Pool

Function

This API is used to obtain the monitored resource pool information.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/pools/{pool_name}/monitor

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

pool_name

Yes

String

Automatically generated resource pool name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

time_range

No

String

Query time range. The default value is -1.-1.60. The format is startTimeInMillis.endTimeInMillis.durationInMinutes. The parameters are described as follows:

  • startTimeInMillis: query start time, in milliseconds. If this parameter is set to -1, the server calculates the start time based on (endTimeInMillis - durationInMinutes * 60 * 1000).

  • endTimeInMillis: query end time, in milliseconds. If this parameter is set to -1, the server calculates the end time based on startTimeInMillis + durationInMinutes * 60 * 1000. If the calculated end time is later than the current system time, the current system time is used.

  • durationInMinutes: time span (in minutes) of the query time. The value must be greater than 0 and greater than or equal to (endTimeInMillis - startTimeInMillis) / (60 * 1000) - 1. If both the start time and end time are set to -1, the system sets the end time to the current time in milliseconds and calculates the start time based on (endTimeInMillis - durationInMinutes * 60 * 1000). Example: -1.-1.60 (indicating the last 60 minutes) Constraint: In a single request, the query duration and period must meet the following condition: durationInMinutes * 60 / period <= 1440.

statistics

No

String

Statistic. The options are as follows:

  • maximum: maximum value statistics, which is the default value

  • minimun: minimum value statistics

  • sum: sum statistics

  • average: average value statistics

  • sampleCount: sampling statistics

period

No

String

Monitoring data granularity, in seconds. The options are as follows:

  • 60: The granularity is 1 minute, which is the default value.

  • 300: The granularity is 5 minutes.

  • 900: The interval is 15 minutes.

  • 3600: The interval is 1 hour.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

metrics

Array of metrics objects

Specifies the list of metric objects. Value range: The JSON array size cannot exceed 20.

Table 4 metrics

Parameter

Type

Description

metric

metric object

Indicates the indicator parameter set.

dataPoints

Array of dataPoints objects

Key metric.

Table 5 metric

Parameter

Type

Description

dimensions

Array of dimensions objects

List of metric dimensions.

metricName

String

Metric name.

namespace

String

Specifies the metric namespace The options are as follows:

  • PAAS.CONTAINER: namespace of component metrics, instance metrics, process metrics, and container metrics

  • PAAS.NODE: namespace of host, network, disk, and file system metrics

  • PAAS.SLA: indicates the namespace of SLA metrics.

  • PAAS.AGGR: namespace of cluster metrics

  • CUSTOMMETRICS: default namespace of a user-defined metric

Table 6 dimensions

Parameter

Type

Description

name

String

Indicator dimension name.

value

String

Indicator dimension value.

Table 7 dataPoints

Parameter

Type

Description

timestamp

Integer

Timestamp.

unit

String

Time series unit.

statistics

Array of statistics objects

List of statistical values.

Table 8 statistics

Parameter

Type

Description

statistic

String

Statistic.

value

Float

Statistical result.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error codes of ModelArts.

error_msg

String

Error message.

Example Requests

Obtain the monitored resource pool information.

GET https://{endpoint}/v2/{project_id}/pools/{pool_name}/monitor

{ }

Example Responses

Status code: 200

OK

{
  "metrics" : [ {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "cpuUsage",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 7.944
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 7.88
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "memUsedRate",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 13.83
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 13.836
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "gpuUtil",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "gpuMemUsage",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "npuUtil",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "npuMemUsage",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "",
      "statistics" : [ {
        "statistic" : "average",
        "value" : -1
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "diskAvailableCapacity",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Megabytes",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 834383.4
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Megabytes",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 834379.2
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "diskCapacity",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Megabytes",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 1105920
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Megabytes",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 1105920
      } ]
    } ]
  }, {
    "metric" : {
      "dimensions" : [ {
        "name" : "clusterId",
        "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3"
      } ],
      "metricName" : "diskUsedRate",
      "namespace" : "PAAS.AGGR"
    },
    "dataPoints" : [ {
      "timestamp" : 1655193600000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 24.553
      } ]
    }, {
      "timestamp" : 1655197200000,
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "average",
        "value" : 24.553
      } ]
    } ]
  } ]
}

Status code: 404

Not found.

{
  "error_code" : "ModelArts.50015001",
  "error_msg" : "pool not found"
}

Status Codes

Status Code

Description

200

OK

404

Not found.

Error Codes

See Error Codes.