DB Viewer - Mongotop Read
Endpoint
/o/db/mongotop
Overview
Returns the read and write time spent per collection, as reported by the MongoDB mongotop tool, connected with the settings of the main Countly database.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
Requires global admin access.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Conditional | Required if auth_token is not provided. |
auth_token | String | Conditional | Required if api_key is not provided. |
Examples
Read mongotop output
/o/db/mongotop?api_key=YOUR_API_KEY
Response
Success Response
[
["ns", "total", "read", "write"],
["countly.events_data", "10ms", "8ms", "2ms"]
]
Response Fields
| Field | Type | Description |
|---|---|---|
(root array) | Array | One row per line of tool output. Each row is an array of strings, split on whitespace. |
Error Responses
401
{
"result": "User does not have right"
}
Behavior
- Runs
mongotopon the server and returns its first output.