DescribeProcessStatsComposition

Updated at: 2025-03-28 07:01

You can call this operation to query session information.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
OperationAccess levelResource typeCondition keyAssociated operation
oceanbase:DescribeProcessStatsCompositionget
*Instance
acs:oceanbase:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the OceanBase cluster.

ob317v4uif****
UIdstringNo

The user identifier (UID) of the OceanBase database.

139*************
TenantIdstringNo

The ID of the tenant.

t33h8y08k****
SqlTextstringNo

The SQL statement, which can contain LIKE clauses. You can specify only part of the clauses in the SQL statement.

SELECT **** FROM **** WHERE **** = ? AND **** = ? ORDER BY **** ASC
ClientIpstringNo

The IP address of the client.

127.*.*.*
ServerIpstringNo

The IP address of the server.

127.*.*.*
UsersstringNo

The username of the database.

["test_user"]
StatusstringNo

The status of the session.

ACTIVE

Response parameters

ParameterTypeDescriptionExample
ParameterTypeDescriptionExample
object

The return result of the request.

RequestIdstring

The request ID.

EE205C00-30E4-****-****-87E3A8A2AA0C
Dataobject

The return result.

TotalSessionCountinteger

The total number of sessions.

100
ActiveSessionCountinteger

The number of active sessions.

60
IdleSessionCountinteger

The number of sessions in the SLEEP state.

30
AllProcessListarray<object>

The details of all sessions.

AllProcessListobject

The details of all sessions.

SqlTextstring

The SQL text.

select * from c1 where id = 100;
TenantIdstring

The ID of the tenant.

test_mysql
Databasestring

The name of the database.

c1
Userstring

The user to which the session belongs.

test_user
ExecuteTimelong

The definition of this parameter varies based on whether the SQL statement is executed.

  • When the request is accepted and the result is not returned to the client, this parameter indicates the time interval between the time when the request is accepted and the current time, in seconds.
  • When the request is not accepted, this parameter indicates the duration for which the current status lasts, in seconds.
5
CpuTimelong

The CPU time spent on executing the current SQL statement, in seconds.

Note
This parameter is introduced since OceanBase Database V3.2.4 BP5.
1
ServerIpstring

The IP address of the server.

xx.xx.xx.xx
ClientIpstring

The IP address of the client.

xx.xx.xx.xx
SessionIdlong

The ID of the session.

322441****
ProxySessIdstring

The session ID of the client. If an OceanBase Database Proxy (ODP) is used for connection, the session ID of the ODP is returned.

7521015416********
Commandstring

The type of the SQL statement being executed in the session.

Query
Statusstring

The status of the session.

ACTIVE
SqlIdstring

The ID of the SQL statement.

45CCBDC7DEBDCDAXXXXAFC********
TraceIdstring

The ID of the trace.

YB420XXX128-00062XXXX8313XXX1-X-X
PlanIdstring

The ID of the execution plan.

1898
SessionStatisticsobject

The session data in different dimensions.

UserStatisticsarray<object>

The session data in the user dimension.

UserStatisticsobject

The session data in the user dimension.

MetricValuestring

The username.

test_user
ActiveCountlong

The number of active sessions.

25
TotalCountlong

The total number of entries returned.

30
Typestring

The dimension. This value is fixed to user.

user
SourceStatisticsarray<object>

The session data in the client dimension.

SourceStatisticsobject

The session data in the client dimension.

MetricValuestring

The IP address of the client.

xx.xx.xx.xx
ActiveCountlong

The number of active sessions.

25
TotalCountlong

The total number of entries returned.

30
Typestring

The dimension. This value is fixed to client.

client
DataBaseStatisticsarray<object>

The session data in the database dimension.

DataBaseStatisticsobject

The session data in the database dimension.

MetricValuestring

The name of the database.

test_database
ActiveCountlong

The number of active sessions.

25
TotalCountlong

The total number of entries returned.

30
Typestring

The dimension. This value is fixed to database.

database
ObVersionstring

The version of OceanBase Database.

3.2.4

Examples

Sample success responses

JSONformat

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": {
    "TotalSessionCount": 100,
    "ActiveSessionCount": 60,
    "IdleSessionCount": 30,
    "AllProcessList": [
      {
        "SqlText": "select * from c1 where id = 100;",
        "TenantId": "test_mysql",
        "Database": "c1",
        "User": "test_user",
        "ExecuteTime": 5,
        "CpuTime": 1,
        "ServerIp": "xx.xx.xx.xx",
        "ClientIp": "xx.xx.xx.xx",
        "SessionId": 0,
        "ProxySessId": "7521015416********",
        "Command": "Query",
        "Status": "ACTIVE",
        "SqlId": "45CCBDC7DEBDCDAXXXXAFC********",
        "TraceId": "YB420XXX128-00062XXXX8313XXX1-X-X",
        "PlanId": "1898"
      }
    ],
    "SessionStatistics": {
      "UserStatistics": [
        {
          "MetricValue": "test_user",
          "ActiveCount": 25,
          "TotalCount": 30,
          "Type": "user"
        }
      ],
      "SourceStatistics": [
        {
          "MetricValue": "xx.xx.xx.xx",
          "ActiveCount": 25,
          "TotalCount": 30,
          "Type": "client"
        }
      ],
      "DataBaseStatistics": [
        {
          "MetricValue": "test_database",
          "ActiveCount": 25,
          "TotalCount": 30,
          "Type": "database"
        }
      ]
    },
    "ObVersion": "3.2.4"
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
Change timeSummary of changesOperation
2024-05-27The response structure of the API has changedView Change Details
  • On this page (0)
  • Debugging
  • Authorization information
  • Request parameters
  • Response parameters
  • Examples
  • Error codes
  • Change history
Feedback