Retrieving slowest database queries
The GET method of the Slowest Database Queries API retrieves data about the slowest database queries for a specified time, application, and database for applications monitored by App Visibility Manager.
The API contains the following sections:
API overview
Method—GET
Request parameters—timestamp, application, dbId, limit
API registration
Use the following URL to register the API:
https://portalHost:portalPort/portal/rest/db/top-slowest
Replace the following entries, as required:
Entry | Description |
---|---|
https | Protocol used to send the request |
portalHost | Host name or IP address of the App Visibility portal |
portalPort | Communication port number of the App Visibility portal. The default port number is 8100. |
Request parameters
Entry | Description | Mandatory |
---|---|---|
timestamp | Epoch time stamp of the problem, in milliseconds, from which to start the data collection Use a time stamp converter, such as http://www.epochconverter.com/, to generate the value. | Yes |
application | Identifying string (automatically assigned) of the application Example: applicationId=appID1 | Yes |
dbId | Identifying string (automatically assigned) of the database Example: dbId=dbID1 | Yes |
limit | Maximum number of queries to return | Yes |
URL example
https://my-portal-33:8100/portal/rest/db/top-slowest?timestamp=1441692600000&application=appId1&dbId=dbID1&limit=10
Sample JSON response
{
"db": " dbID1",
"query": "Insert@testdb.users",
"minLatency": 100,
"maxLatency": 5000,
"avgLatency": 300,
"count": 2,
"latencyViolationCount": 0
}
]
Response content
The response shows data about impacted database queries since the specified time.
Object | Description |
---|---|
db | Identifying string (automatically assigned) of the database |
query | Database query name |
minLatency | Time, in milliseconds, of the fastest query since the specified time |
maxLatency | Time, in milliseconds, of the slowest query since the specified time |
avgLatency | Average time, in milliseconds, of queries since the specified time |
count | Number of queries since the specified time |
latencyViolationCount | Number of queries with latency violations |
Related topics
Using APIs to generate report data for App Visibility Manager