You can use the following APIs to manage the statistics.
|
Syntax |
Description |
|---|---|
|
Loads the summary statistics of all requests. |
|
|
Loads the detailed statistics of all requests or only failed requests. |
|
|
Loads the summary statistics of all transactions. |
|
|
Loads the detailed statistics of failed transactions. |
|
|
Loads the detailed statistics of successful transactions. |
Loads the summary statistics of all requests.
Syntax: GET /api/Statistics/LoadRequestSummaryStatistics
PowerScript code example:
Integer li_rc
String ls_body
httpclient lhc_client
lhc_client = create httpclient
lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)
li_rc = lhc_client.sendrequest( "Get", "http://172.25.100.32:5000/api/Statistics/LoadRequestSummaryStatistics")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
lhc_client.getrequestbody(ls_body)
end if
When successful, it returns the response status code 200 and the following response body:
When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).
{
"queryRequests": 0,
"commandRequests": 0,
"eSqlRequests": 0,
"dataStoreRequests": 0,
"transactionalRequests": 0,
"failedRequests": 0
}
Loads the detailed statistics of all requests or failed requests only.
Syntax: GET /api/Statistics/LoadRequestsStatistics/{failedOnly}
{failedOnly} indicates the failed requests.
PowerScript code example:
Integer li_rc
String ls_body
httpclient lhc_client
lhc_client = create httpclient
lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)
li_rc = lhc_client.sendrequest( "Get", "http://172.25.100.32:5000/api/Statistics/LoadRequestsStatistics/true")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
lhc_client.getrequestbody(ls_body)
end if
When successful, it returns the response status code 200 and the following response body:
When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).
[
{
"executionStart": "2022-02-21T02:24:02.420Z",
"executionTime": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"isSuccess": true,
"transactionId": {},
"dbRequestKind": 0,
"requestDataFormat": 0,
"moduleOrModelName": "string",
"sqlId": "string",
"sqlStatement": "string",
"sqlParameters": [
"string"
],
"columnCount": 0,
"rowCount": 0,
"hasResultSet": true,
"resultLength": 0,
"sqlDbCode": 0,
"errorMessage": "string"
}
]
Loads the summary statistics of all transactions.
Syntax: GET /api/Statistics/LoadTransactionSummaryStatistics
PowerScript code example:
Integer li_rc
String ls_body
httpclient lhc_client
lhc_client = create httpclient
lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)
li_rc = lhc_client.sendrequest( "Get", "http://172.25.100.32:5000/api/Statistics/LoadTransactionSummaryStatistics")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
lhc_client.getrequestbody(ls_body)
end if
When successful, it returns the response status code 200 and the following response body:
When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).
{
"transactionsCreated": 0,
"transactionsStarted": 0,
"transactionsSucceeded": 0,
"transactionsFailed": 0,
"totalRequests": 0
}
Loads the detailed statistics of failed transactions.
Syntax: GET /api/Statistics/LoadFailedTransactionsStatistics
PowerScript code example:
Integer li_rc
String ls_body
httpclient lhc_client
lhc_client = create httpclient
lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)
li_rc = lhc_client.sendrequest( "Get", "http://172.25.100.32:5000/api/Statistics/LoadFailedTransactionsStatistics")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
lhc_client.getrequestbody(ls_body)
end if
When successful, it returns the response status code 200 and the following response body:
When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).
[
{
"createdTime": "2022-02-21T02:35:59.790Z",
"startedTime": "2022-02-21T02:35:59.790Z",
"executionTime": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"transactionId": "string",
"transactionStatus": 0,
"requestsStatistics": [
{
"executionStart": "2022-02-21T02:35:59.790Z",
"executionTime": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"isSuccess": true,
"transactionId": {},
"dbRequestKind": 0,
"requestDataFormat": 0,
"moduleOrModelName": "string",
"sqlId": "string",
"sqlStatement": "string",
"sqlParameters": [
"string"
],
"columnCount": 0,
"rowCount": 0,
"hasResultSet": true,
"resultLength": 0,
"sqlDbCode": 0,
"errorMessage": "string"
}
]
}
]
Loads the detailed statistics of successful transactions.
Syntax: GET /api/Statistics/LoadSucceedTransactionsStatistics
PowerScript code example:
Integer li_rc
String ls_body
httpclient lhc_client
lhc_client = create httpclient
lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)
li_rc = lhc_client.sendrequest( "Get", "http://172.25.100.32:5000/api/Statistics/LoadSucceedTransactionsStatistics")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
lhc_client.getrequestbody(ls_body)
end if
When successful, it returns the response status code 200 and the following response body:
When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).
[
{
"createdTime": "2022-02-21T02:41:27.288Z",
"startedTime": "2022-02-21T02:41:27.288Z",
"executionTime": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"transactionId": "string",
"transactionStatus": 0,
"requestsStatistics": [
{
"executionStart": "2022-02-21T02:41:27.288Z",
"executionTime": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"isSuccess": true,
"transactionId": {},
"dbRequestKind": 0,
"requestDataFormat": 0,
"moduleOrModelName": "string",
"sqlId": "string",
"sqlStatement": "string",
"sqlParameters": [
"string"
],
"columnCount": 0,
"rowCount": 0,
"hasResultSet": true,
"resultLength": 0,
"sqlDbCode": 0,
"errorMessage": "string"
}
]
}
]


