arangosh> var theQuery = 'FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong';
arangosh> var tasks = require("@arangodb/tasks");
arangosh> tasks.register({
........> id: "mytask-1",
........> name: "this is a sample task to spawn a slow aql query",
........> command: "require('internal').db._query('" + theQuery + "');"
........> });
{
"id" : "mytask-1",
"name" : "this is a sample task to spawn a slow aql query",
"type" : "timed",
"offset" : 0.00001,
"created" : 1462973626.078065,
"command" : "require('internal').db._query('FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLE...",
"database" : "_system",
"code" : 200
}
arangosh> queries.current();
[
{
"id" : "217",
"query" : "FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong",
"runTime" : 1.0442829132080078,
"started" : "2016-05-11T13:33:46Z",
"state" : "executing"
}
]