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" : 1466413074.659226,
"command" : "require('internal').db._query('FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLE...",
"database" : "_system",
"code" : 200
}
arangosh> queries.current();
[
{
"id" : "220",
"query" : "FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong",
"started" : "2016-06-20T08:57:54Z",
"runTime" : 1.0286262035369873,
"state" : "executing"
}
]