ArangoDB v4.x is under development and not released yet.
This documentation is not final and potentially incomplete.
The @arangodb/activities module of the JavaScript API
The @arangodb/activities module lets you pretty-print the current server activities
const activities = require('@arangodb/activities')
For information about the server-side activities API, see the HTTP interface for server activities.
get_snapshot()
This method lets you pretty-print the high-level processes that are currently running on the server, such as HTTP request handlers and AQL queries, in a tree-like format.
You need to have the necessary permissions to access the activities API of the server.
Examples
const activities = require("@arangodb/activities");
activities.get_snapshot(); ── RestHandler: {"method":"GET","url":"/_admin/activities","handler":"ActivityRegistryRestHandler"}
── RestHandler: {"method":"POST","url":"/_api/cursor","handler":"RestCursorHandler"}
└── AqlQuery: {"queryId":0,"startTime":22023.926836231,"database":"_system","user":"","queryString":"RETURN SLEEP(50)", ... }
