Skip to main content
Version: 24.05

DB Viewer - Mongotop

Endpoint​

/o/db/mongotop

Overview​

Returns a snapshot of how much time the database server spends reading and writing each collection, taken with the mongotop tool.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires a global admin user.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

Read a mongotop snapshot​

/o/db/mongotop?api_key=YOUR_API_KEY

Response​

Success Response​

[
["ns", "total", "read", "write", "2026-10-17T10:00:00Z"],
["countly.members", "0ms", "0ms", "0ms"]
]

Response Fields​

FieldTypeDescription
(root array)ArrayThe output of mongotop, one array of text values per line. The first array is the header line.

Behavior​

  • Runs mongotop against the Countly database once and returns its first output.
  • The mongotop tool must be installed on the server.
Implementation details

Database Collections

This endpoint does not read a Countly collection; it runs the mongotop tool against the database server.