All Products
Search
Document Center

Database Autonomy Service:GetPfsMetricTrends

Last Updated:Apr 25, 2024

Queries the trend of a metric for the new version of the performance insight feature of a database instance.

Operation description

Before you call this operation, take note of the following items:

  • If you use an Alibaba Cloud SDK or a Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
  • If you use an SDK to call operations of DAS, you must set the region ID to cn-shanghai.
  • An ApsaraDB RDS for MySQL instance or a PolarDB for MySQL cluster is connected to DAS.
  • The new version of the performance insight feature is enabled for the database instance. For more information, see Performance insight (new version).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
hdm:GetPfsMetricTrendsRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The instance ID.

rm-m5ea73876ukci****
NodeIdstringNo

The node ID.

Note You must specify this parameter for an ApsaraDB RDS for MySQL cluster instance and a PolarDB for MySQL cluster.
r-x****-db-0
MetricstringNo

The metric whose trend you want to query. Valid values:

  • count: the number of executions.
  • avgRt: the average execution duration.
  • rtRate: the execution duration percentage.
  • rowsExamined: the total number of scanned rows.
Count
StartTimelongNo

The beginning of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1677461663092
EndTimelongNo

The end of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note The end time must be later than the start time. You can view the data of up to seven days in the previous 30 days.
1678432430967

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

The returned message.

Note If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.
Successful
RequestIdstring

The request ID.

F4C27966-284E-51C4-9407-DB50CAB8****
Dataobject

The data returned.

object []

The details of the data returned.

Timestampstring

The timestamp. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1681975870000
Valueany

The value of the metric.

478.28
Codelong

The HTTP status code returned.

200
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "Message": "Successful",
  "RequestId": "F4C27966-284E-51C4-9407-DB50CAB8****",
  "Data": {
    "key": [
      {
        "Timestamp": "1681975870000",
        "Value": "478.28"
      }
    ]
  },
  "Code": 200,
  "Success": true
}

Error codes

HTTP status codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history