tencent cloud

Feedback

DescribeSlowLogTimeSeriesStats

Last updated: 2021-07-13 17:27:41

1. API Description

Domain name for API request: dbbrain.tencentcloudapi.com.

This API is used to get the slow log statistics histogram.

A maximum of 5 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: dbbrain.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeSlowLogTimeSeriesStats.
Version Yes String Common parameter. The value used for this API: 2019-10-16.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
InstanceId Yes String Instance ID.
StartTime Yes Timestamp Start time, such as "2019-09-10 12:13:14".
EndTime Yes Timestamp End time, such as "2019-09-10 12:13:14". The interval between the end time and the start time can be up to 7 days.
Product No String Service type. Valid values: mysql (TencentDB for MySQL), cynosdb (TencentDB for CynosDB (compatible with MySQL)). Default value: mysql.

3. Output Parameters

Parameter Name Type Description
Period Integer Time range in seconds in histogram.
TimeSeries Array of TimeSlice Number of slow logs in specified time range.
SeriesData MonitorMetricSeriesData Instance CPU utilization monitoring data in specified time range.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Getting the slow log statistics histogram

Input Example

https://dbbrain.tencentcloudapi.com/?Action=DescribeSlowLogTimeSeriesStats
&InstanceId=test
&StartTime=2019-01-01 00:00:00
&EndTime=2019-01-01 01:00:00
&<common request parameters>

Output Example

{
  "Response": {
    "TimeSeries": [
      {
        "Count": 0,
        "Timestamp": 1568113800
      },
      {
        "Count": 0,
        "Timestamp": 1568191680
      },
      {
        "Count": 0,
        "Timestamp": 1568269560
      },
      {
        "Count": 0,
        "Timestamp": 1568347440
      },
      {
        "Count": 2,
        "Timestamp": 1568425320
      },
      {
        "Count": 0,
        "Timestamp": 1568503200
      },
      {
        "Count": 0,
        "Timestamp": 1568581080
      },
      {
        "Count": 0,
        "Timestamp": 1568658960
      },
      {
        "Count": 0,
        "Timestamp": 1568736840
      },
      {
        "Count": 0,
        "Timestamp": 1568814720
      },
      {
        "Count": 0,
        "Timestamp": 1568892600
      },
      {
        "Count": 0,
        "Timestamp": 1568970480
      },
      {
        "Count": 0,
        "Timestamp": 1569048360
      },
      {
        "Count": 0,
        "Timestamp": 1569126240
      },
      {
        "Count": 0,
        "Timestamp": 1569204120
      },
      {
        "Count": 0,
        "Timestamp": 1569282000
      },
      {
        "Count": 0,
        "Timestamp": 1569359880
      },
      {
        "Count": 0,
        "Timestamp": 1569437760
      },
      {
        "Count": 0,
        "Timestamp": 1569515640
      },
      {
        "Count": 0,
        "Timestamp": 1569593520
      },
      {
        "Count": 0,
        "Timestamp": 1569671400
      },
      {
        "Count": 0,
        "Timestamp": 1569749280
      },
      {
        "Count": 0,
        "Timestamp": 1569827160
      },
      {
        "Count": 0,
        "Timestamp": 1569905040
      },
      {
        "Count": 0,
        "Timestamp": 1569982920
      },
      {
        "Count": 0,
        "Timestamp": 1570060800
      },
      {
        "Count": 0,
        "Timestamp": 1570138680
      },
      {
        "Count": 0,
        "Timestamp": 1570216560
      },
      {
        "Count": 0,
        "Timestamp": 1570294440
      },
      {
        "Count": 0,
        "Timestamp": 1570372320
      },
      {
        "Count": 0,
        "Timestamp": 1570450200
      }
    ],
    "SeriesData": {
      "Series": [
        {
          "Values": [
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1,
            -1
          ],
          "Metric": "cpu_use_rate",
          "Unit": "%"
        }
      ],
      "Timestamp": [
        1568113800,
        1568191680,
        1568269560,
        1568347440,
        1568425320,
        1568503200,
        1568581080,
        1568658960,
        1568736840,
        1568814720,
        1568892600,
        1568970480,
        1569048360,
        1569126240,
        1569204120,
        1569282000,
        1569359880,
        1569437760,
        1569515640,
        1569593520,
        1569671400,
        1569749280,
        1569827160,
        1569905040,
        1569982920,
        1570060800,
        1570138680,
        1570216560,
        1570294440,
        1570372320,
        1570450200
      ]
    },
    "RequestId": "b445f8ee-9357-4d93-83c2-3596f9d1f27e",
    "Period": 77880
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
OperationDenied.UserHasNoStrategy Error with CAM authentication.