Obtém assincronamente os dados de tendência de logs lentos de uma instância.
Descrição da operação
Antes de chamar esta operação, certifique-se de entender os métodos de cobrança e preços do DAS.
Os seguintes pré-requisitos devem ser atendidos:
-
Você deve ativar o DAS Enterprise Edition ou o serviço de operações e manutenção (O&M) inteligente para a instância. O serviço de O&M inteligente ainda não foi publicado.
-
Use a versão mais recente do SDK do Alibaba Cloud ou do SDK do DAS.
-
Ao usar um SDK para chamar o serviço DAS, defina a região como cn-shanghai.
Esta é uma operação assíncrona. Um resultado completo não é retornado imediatamente. Se o parâmetro isFinish na resposta for false, aguarde 1 segundo e chame a operação novamente. Repita a chamada até que o parâmetro isFinish seja true. Em seguida, o resultado completo é retornado.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
hdm:DescribeSlowLogHistogramAsync |
get |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| InstanceId |
string |
Sim |
O ID da instância de banco de dados. |
rm-2ze8g2am97624**** |
| NodeId |
string |
Não |
O ID do nó. Nota
Para instâncias do PolarDB for MySQL, você deve especificar o ID do nó. |
r-****-db-0 |
| StartTime |
integer |
Sim |
O início do intervalo de tempo a ser consultado. Especifique o tempo como um carimbo de data/hora UNIX em milissegundos. |
1596177993000 |
| EndTime |
integer |
Sim |
O fim do intervalo de tempo a ser consultado. Especifique o tempo como um carimbo de data/hora UNIX em milissegundos. Nota
O horário de término deve ser posterior ao horário de início. |
1662518540764 |
| Filters |
array<object> |
Não |
Uma lista de condições de filtro de consulta. |
|
|
object |
Não |
Os seguintes valores são suportados para o parâmetro Key: hostAddress: O endereço de origem. Para especificar vários endereços, separe-os por vírgulas. sqlId: O ID do SQL. Para especificar vários IDs, separe-os por vírgulas. user: O nome de usuário. Para especificar vários nomes de usuário, separe-os por vírgulas. dbName: O nome do banco de dados. Para especificar vários nomes de banco de dados, separe-os por vírgulas. |
||
| Key |
string |
Não |
A chave do filtro. |
None |
| Value |
string |
Não |
O valor do parâmetro de filtro. |
None |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| Code |
string |
O código de status HTTP retornado. |
200 |
| Message |
string |
A mensagem retornada. Nota
Se a solicitação for bem-sucedida, Successful será retornado. Se a solicitação falhar, uma mensagem de erro será retornada. |
Successful |
| RequestId |
string |
O ID da solicitação. |
B6D17591-B48B-4D31-9CD6-9B9796B2**** |
| Success |
string |
Indica se a solicitação foi bem-sucedida. Valores válidos:
|
true |
| Data |
object |
Os dados detalhados da tarefa assíncrona. |
|
| RequestKey |
string |
A chave do parâmetro de solicitação. |
无 |
| ResultId |
string |
O ID do resultado da tarefa assíncrona. |
async__20ee808e72257f16a4fe024057ca**** |
| State |
string |
O estado da tarefa assíncrona. Valores válidos:
|
SUCCESS |
| IsFinish |
boolean |
Indica se a tarefa assíncrona está concluída. |
true |
| Data |
object |
Os dados retornados. |
|
| Total |
integer |
The total number of entries returned. |
1 |
| Count |
array |
The number of slow query logs in the trend chart. |
|
|
integer |
The number of slow query logs. |
100 |
|
| Ts |
array |
This parameter is returned only for relational databases. |
|
|
integer |
The time when the first event occurred. This value is a UNIX timestamp in milliseconds. |
[ 1735098480000, 1735098540000, 1735098600000, 1735098660000, 1735098720000, 1735098780000 ] |
|
| TsEnd |
array |
This parameter is reserved. |
|
|
integer |
The end timestamp of the query. |
暂无 |
|
| Item |
array<object> |
The trend metrics. |
|
|
array<object> |
The name of the project. |
||
| NodeId |
string |
The node ID. |
r-bp1hi0wg57s3n0i3n8-db-0 |
| Count |
array |
The number of slow query logs. |
|
|
integer |
The number of slow query logs. |
100 |
|
| InsItems |
array<object> |
The trend metrics. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
object |
The trend metrics. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
||
| InsId |
string |
The ID of the instance role. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
2492 |
| InsRole |
string |
The role of the instance. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
userAdmin |
| Count |
array |
The number of executions. |
|
|
integer |
The number of executions. |
1 |
|
| TotalCount |
integer |
The number of slow query logs on the physical node. |
10 |
| TotalCount |
integer |
The total number of slow query logs. |
20 |
| InsRole |
string |
The role of the instance. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
| Rt |
array |
The total execution duration, in seconds. |
|
|
number |
The total execution duration, in seconds. |
[ 2.306, 1.141, 0.0, 4.538, 1.247, 1.972 ] |
|
| AvgRt |
array |
The average execution duration. |
|
|
number |
The average execution duration. |
[ 1.593, 2.306, 1.141, 0.0, 1.5127, 1.247 ] |
|
| MaxRt |
array |
The maximum execution duration, in seconds. |
|
|
number |
The maximum execution duration, in seconds. |
[ 1.593, 2.306, 1.141, 14.115 0.0, 1.972 ] |
|
| LockTime |
array |
The total lock wait duration, in seconds. |
|
|
number |
The total lock wait duration, in seconds. |
[ 1.051, 1.007, 0.0, 0.755, 0.096, 0.0 ] |
|
| AvgLockTime |
array |
The average lock wait duration, in seconds. |
|
|
number |
The average lock wait duration, in seconds. |
[ 1.051, 0.0, 0.3357, 0.755, 0.324, 0.814 ] |
|
| MaxLockTime |
array |
The maximum lock wait duration, in seconds. |
|
|
number |
The maximum lock wait duration, in seconds. |
[ 1.051, 1.007, 0.755, 0.0, 0.05, 0.656 ] |
|
| RowsExamined |
array |
The total number of scanned rows. Nota
This parameter is returned for the following database engines: ApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, and PolarDB for MySQL. |
|
|
integer |
The total number of scanned rows. Nota
This parameter is returned for the following database engines: ApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, and PolarDB for MySQL. |
[ 256, 1, 512, 0, 1476678, 24430 ] |
|
| AvgRowsExamined |
array |
The average number of scanned rows. |
|
|
number |
The average number of scanned rows. |
[ 256.0, 256.3333, 512.0, 370860.1111, 0.0, 1.0 ] |
|
| MaxRowsExamined |
array |
The maximum number of scanned rows. |
|
|
integer |
The maximum number of scanned rows. |
[ 256, 1, 512, 0, 1476678, 24430 ] |
|
| RowsSent |
array |
The number of returned rows. |
|
|
integer |
The number of returned rows. |
[ 384, 256, 0, 207030, 4, 256 ] |
|
| AvgRowsSent |
array |
The average number of returned rows. |
|
|
number |
The average number of returned rows. |
[ 128.0, 0.0, 256.0, 25878.75, 192.0, 72.7778 ] |
|
| MaxRowsSent |
array |
The maximum number of returned rows. |
|
|
integer |
The maximum number of returned rows. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| KeysExamined |
array |
The number of scanned index rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
integer |
The number of scanned index rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 384, 256, 0, 207030, 4, 256 ] |
|
| AvgKeysExamined |
array |
The average number of scanned index rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
number |
The average number of scanned index rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 128.0, 0.0, 256.0, 25878.75, 192.0, 72.7778 ] |
|
| MaxKeysExamined |
array |
The maximum number of scanned index rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
integer |
The maximum number of scanned index rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 384, 256, 0, 207030, 4, 256 ] |
|
| DocExamined |
array |
The number of scanned documents. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
integer |
The number of scanned documents. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| AvgDocExamined |
array |
The average number of scanned documents. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
number |
The average number of scanned documents. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 128.0, 0.0, 256.0, 25878.75, 192.0, 72.7778 ] |
|
| MaxDocExamined |
array |
The maximum number of scanned documents. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
integer |
The maximum number of scanned documents. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| ReturnNum |
array |
The number of returned rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
integer |
The number of returned rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| AvgReturnNum |
array |
The average number of returned rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
number |
The average number of returned rows Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 128.0, 0.0, 256.0, 25878.75, 192.0, 72.7778 ] |
|
| MaxReturnNum |
array |
The maximum number of returned rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
|
|
integer |
The maximum number of returned rows. Nota
This parameter is returned only for ApsaraDB for MongoDB instances. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| IOWrites |
array |
The number of I/O writes. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The number of I/O writes. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| AvgIOWrites |
array |
The average number of I/O writes. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The average number of I/O writes. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 384, 256, 0, 207030, 4, 256 ] |
|
| MaxIOWrites |
array |
The maximum number of I/O writes. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The maximum number of I/O writes. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 256, 1, 512, 0, 1476678, 24430 ] |
|
| LastRowsCountAffected |
array |
The number of rows affected by the last statement. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The number of rows affected by the last statement. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 256, 207023, 0, 128, 0, 0 ] |
|
| AvgLastRowsCountAffected |
array |
The average number of rows affected by the last statement. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The average number of rows affected by the last statement. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 1.593, 2.306, 1.141, 0.0, 1.5127, 1.247 ] |
|
| MaxLastRowsCountAffected |
array |
The maximum number of rows affected by the last statement. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The average number of rows affected by the last statement. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 1, 1, 3, 1, 2, 3 ] |
|
| LogicalIOReads |
array |
The number of logical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The number of logical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 384, 256, 0, 207030, 4, 256 ] |
|
| AvgLogicalIOReads |
array |
The average number of logical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The average number of logical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 1.593, 2.306, 1.141, 0.0, 1.5127, 1.247 ] |
|
| MaxLogicalIOReads |
array |
The maximum number of logical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The maximum number of logical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 124, 2, 24, 251, 191, 721 ] |
|
| PhysicalIOReads |
array |
The number of physical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The number of physical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 324, 22, 254, 251, 191, 721 ] |
|
| AvgPhysicalIOReads |
array |
The average number of physical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The average number of physical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 128.0, 0.0, 256.0, 25878.75, 192.0, 72.7778 ] |
|
| MaxPhysicalIOReads |
array |
The maximum number of physical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The maximum number of physical reads. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 314, 242, 114, 351, 191, 721 ] |
|
| RowsCountAffected |
array |
The number of affected rows. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The number of affected rows. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 34, 42, 14, 51, 91, 71 ] |
|
| AvgRowsCountAffected |
array |
The average number of affected rows. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The average number of affected rows. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 1.593, 2.306, 1.141, 14.115, 0.0, 1.783, 0.0, 1.972 ] |
|
| MaxRowsCountAffected |
array |
The maximum number of affected rows. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
integer |
The maximum number of affected rows. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 714, 442, 314, 151, 291, 521 ] |
|
| CPUTime |
array |
The CPU time, in seconds. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The CPU time, in seconds. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 1.051, 1.007, 0.755, 0.0, 0.05, 0.656 ] |
|
| AvgCPUTime |
array |
The average CPU time, in seconds. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The average CPU time, in seconds. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 2.306, 1.141, 0.0, 4.538, 1.247, 0.0 ] |
|
| MaxCPUTime |
array |
The maximum CPU time, in seconds. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
|
|
number |
The maximum CPU time, in seconds. Nota
This parameter is returned only for ApsaraDB RDS for SQL Server instances. |
[ 2.306, 1.141, 0.0, 4.538, 1.247, 0.0 ] |
|
| Rows |
array |
The total number of updated or returned rows on the compute nodes of a PolarDB-X 2.0 instance. Nota
This parameter is returned only for PolarDB-X 2.0 instances. |
|
|
integer |
The total number of updated or returned rows on the compute nodes of a PolarDB-X 2.0 instance. Nota
This parameter is returned only for PolarDB-X 2.0 instances. |
[] |
|
| AvgRows |
array |
The average number of rows. |
|
|
number |
The average number of rows. |
||
| MaxRows |
array |
The maximum number of rows. |
|
|
integer |
The maximum number of rows. |
||
| Frows |
array |
The number of rows pulled by the compute nodes (CNs) of a PolarDB-X 2.0 instance. Nota
This parameter is returned only for PolarDB-X 2.0 instances. |
|
|
integer |
The number of rows pulled by the CNs of a PolarDB-X 2.0 instance. Nota
This parameter is returned only for PolarDB-X 2.0 instances. |
||
| AvgFrows |
array |
The average number of pulled rows. |
|
|
number |
The average number of pulled rows. |
||
| MaxFrows |
array |
The maximum number of pulled rows. |
|
|
integer |
The maximum number of pulled rows. |
||
| Scnt |
array |
The number of requests sent from the compute nodes (CNs) to the data nodes (DNs) of a PolarDB-X 2.0 instance. Nota
This parameter is returned only for PolarDB-X 2.0 instances. |
|
|
integer |
The number of requests sent from the CNs to the DNs of a PolarDB-X 2.0 instance. Nota
This parameter is returned only for PolarDB-X 2.0 instances. |
||
| AvgScnt |
array |
The average number of requests. |
|
|
number |
The average number of requests. |
||
| MaxScnt |
array |
The maximum number of requests. |
|
|
integer |
The maximum number of requests. |
||
| TotalCount |
integer |
The total number of slow query logs. |
5 |
| ErrorCode |
integer |
O código de erro. |
10910 |
| Message |
string |
A mensagem de erro. |
Successful |
| Timestamp |
integer |
A hora em que a solicitação foi feita. |
1645668213000 |
Exemplos
Resposta de sucesso
JSON formato
{
"Code": "200",
"Message": "Successful",
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": "true",
"Data": {
"RequestKey": "无",
"ResultId": "async__20ee808e72257f16a4fe024057ca****",
"State": "SUCCESS",
"IsFinish": true,
"Data": {
"Total": 1,
"Count": [
100
],
"Ts": [
0
],
"TsEnd": [
0
],
"Item": [
{
"NodeId": "r-bp1hi0wg57s3n0i3n8-db-0",
"Count": [
100
],
"InsItems": [
{
"InsId": "2492",
"InsRole": "userAdmin",
"Count": [
1
],
"TotalCount": 10
}
],
"TotalCount": 20,
"InsRole": ""
}
],
"Rt": [
0
],
"AvgRt": [
0
],
"MaxRt": [
0
],
"LockTime": [
0
],
"AvgLockTime": [
0
],
"MaxLockTime": [
0
],
"RowsExamined": [
0
],
"AvgRowsExamined": [
0
],
"MaxRowsExamined": [
0
],
"RowsSent": [
0
],
"AvgRowsSent": [
0
],
"MaxRowsSent": [
0
],
"KeysExamined": [
0
],
"AvgKeysExamined": [
0
],
"MaxKeysExamined": [
0
],
"DocExamined": [
0
],
"AvgDocExamined": [
0
],
"MaxDocExamined": [
0
],
"ReturnNum": [
0
],
"AvgReturnNum": [
0
],
"MaxReturnNum": [
0
],
"IOWrites": [
0
],
"AvgIOWrites": [
0
],
"MaxIOWrites": [
0
],
"LastRowsCountAffected": [
0
],
"AvgLastRowsCountAffected": [
0
],
"MaxLastRowsCountAffected": [
0
],
"LogicalIOReads": [
0
],
"AvgLogicalIOReads": [
0
],
"MaxLogicalIOReads": [
0
],
"PhysicalIOReads": [
0
],
"AvgPhysicalIOReads": [
0
],
"MaxPhysicalIOReads": [
0
],
"RowsCountAffected": [
0
],
"AvgRowsCountAffected": [
0
],
"MaxRowsCountAffected": [
0
],
"CPUTime": [
0
],
"AvgCPUTime": [
0
],
"MaxCPUTime": [
0
],
"Rows": [
0
],
"AvgRows": [
0
],
"MaxRows": [
0
],
"Frows": [
0
],
"AvgFrows": [
0
],
"MaxFrows": [
0
],
"Scnt": [
0
],
"AvgScnt": [
0
],
"MaxScnt": [
0
],
"TotalCount": 5
},
"ErrorCode": 10910,
"Message": "Successful",
"Timestamp": 1645668213000
}
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.