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 + "');"
........> });
{
"command" : "require('internal').db._query('FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLE...",
"created" : 1455113176.995189,
"database" : "_system",
"id" : "mytask-1",
"name" : "this is a sample task to spawn a slow aql query",
"offset" : 0.00001,
"type" : "timed",
"code" : 200
}
arangosh> queries.current();
[
{
"id" : "96",
"query" : "FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong",
"runTime" : 1.8661150932312012,
"started" : "2016-02-10T14:06:17Z",
"state" : "executing"
}
]