Query the performance indicator trend of an execution plan

2023-08-15 02:30:55  Updated

Description

You can call this operation to query the performance trend of an execution plan associated with a specified SQL statement.

Call description

Prerequisite

You have the read privilege on the specified tenant.

Request path

GET /api/v2/ob/clusters/{clusterId}/tenants/{tenantId}/plans/{uid}/trends

Request parameters

Parameter Type Required Example Description
clusterId Integer Yes 1 The ID of the cluster.
tenantId Integer Yes 1001 The ID of the tenant.
uid String Yes AAAAAAAAAAEAAAAAAAKOvgAFs1_j8s3i The UID of the plan.
startTime Datetime Yes 2020-02-16T05:32:16+08:00 The start time.
endTime Datetime Yes 2020-02-16T07:32:16+08:00 The end time.

Response parameters

  • Basic data structure

    Parameter Type Description
    data Object The request data.
    ├─ contents Array The array of planned performance sampling data. For more information about its data structure, see the following table.
    successful Boolean Whether the request is successful.
    timestamp Datetime The timestamp when the server completes the request.
    duration Integer The time that the server takes to process the request, in milliseconds.
    status Integer The encoding in compliance with the HTTP Status specification.
    traceId String The trace ID of the request. This trace ID is used for troubleshooting.
    server String The address of the application server that responds to the request.
  • Data structure of planned performance sampling data

    Parameter Type Description
    timestamp Datetime The timestamp of the sampling.
    executions Integer The number of times the plan is executed during the execution period of the plan.
    execPs Float The average number of times the plan is executed every second during the execution period of the plan.
    maxExecTime Float The longest plan execution time during the execution period of the plan, in milliseconds.
    avgDiskReads Float The average disk read times during the execution period of the plan.
    avgDiskWrites Float The average disk write times during the execution period of the plan.
    avgBufferGets Float The average cache read times during the execution period of the plan.
    avgApplicationWaitTime Float The average Application wait time during the execution period of the plan, in milliseconds.
    avgConcurrencyWaitTime Float The average Concurrency wait time during the execution period of the plan, in milliseconds.
    avgUserIoWaitTime Float The average UserIO wait time during the execution period of the plan, in milliseconds.
    avgRowProcessed Float The average rows processed during the execution period of the plan.
    avgElapsedTime Float The average response time during the execution period of the plan.
    avgCpuTime Float The average CPU time during the execution period of the plan.
    largeQueryPercentage Float The percentage of large queries during the execution period of the plan.
    delayedLargeQueryPercentage Float The percentage of queued large queries during the execution period of the plan.
    timeoutPercentage Float The percentage of timed out executions during the execution period of the plan.
    tableScan Boolean Whether to include full table scan in the plan.

Examples

Sample request

Query the performance trend of the plan with a UID of AAAAAAAAAAEAAAAAAAAJ_AAFszE_cnfR based on the cluster ID 1 and tenant ID 1001, and set the time range to 2020-11-03T19:00:00+08:00 to 2020-11-03T20:00.

/api/v2/ob/clusters/1/tenants/1001/plans/AAAAAAAAAAEAAAAAAAAJ_AAFszE_cnfR/trends?startTime=2020-11-03T19%3A00%3A00%2B08%3A00&endTime=2020-11-03T20%3A00%3A00%2B08%3A00

Sample response

{
    "duration": 818,
    "server": "192.168.100.1",
    "status": 200,
    "successful": true,
    "timestamp": "2020-11-03T21:21:49.554+08:00",
    "traceId": "ebb7f4eb8c984e12",
    "data": {
        "contents": [
            {
                "avgApplicationWaitTime": 0.00,
                "avgBufferGets": 0.00,
                "avgConcurrencyWaitTime": 0.00,
                "avgCpuTime": 0.00,
                "avgDiskReads": 0.00,
                "avgDiskWrites": 0.00,
                "avgElapsedTime": 1.11,
                "avgRowProcessed": 7.65,
                "avgUserIoWaitTime": 0.00,
                "execPs": 4.63,
                "executions": 3,
                "tableScan": false,
                "timestamp": "2020-11-03T19:00:00.00Z"
            },
            {
                "avgApplicationWaitTime": 0.00,
                "avgBufferGets": 0.00,
                "avgConcurrencyWaitTime": 0.00,
                "avgCpuTime": 0.00,
                "avgDiskReads": 0.00,
                "avgDiskWrites": 0.00,
                "avgElapsedTime": 1.09,
                "avgRowProcessed": 7.69,
                "avgUserIoWaitTime": 0.00,
                "execPs": 4.63,
                "executions": 4,
                "tableScan": false,
                "timestamp": "2020-11-03T19:00:30Z"
            }
        ]
    }
}

Contact Us