Skip to main content
Version: 26.01

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​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired 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​

FieldTypeDescription
(root array)ArrayOne 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 mongotop on the server and returns its first output.