You need to be added to the ContributorsGroup to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name. |
HTTP GET _active_tasks
Method |
GET |
|
Path |
/_active_tasks |
|
Query args |
None |
|
Request body |
None |
|
Response body |
JSON array containing objects describing currently active tasks |
|
Description
Returns a list of running tasks.
Example
GET /_active_tasks HTTP/1.1
HTTP/1.1 200 OK
Cache-Control: must-revalidate
[{"type":"Database Compaction","task":"exampledb","status":"Copied 5001 of 14832 changes (33%)","pid":"<0.14557.22>"}]
Changes in CouchDB 1.2.0
The 1.2.0 release offers a more granular active tasks output. Basically, each task can have different properties which are only meaningful for that particular task type. There are currently 4 active task types: "indexer", "replication", "database_compaction", and "view_compaction".
Example
$ curl http://localhost:5984/_active_tasks
[
{
"pid": "<0.242.0>",
"changes_done": 31209,
"database": "indexer_test_3",
"design_document": "_design/test",
"progress": 5,
"started_on": 1316228432,
"total_changes": 551201,
"type": "indexer",
"updated_on": 1316228461
},
{
"pid": "<0.1156.0>",
"database": "indexer_test_3",
"design_document": "_design/test",
"progress": 21,
"started_on": 1316229336,
"type": "view_compaction",
"updated_on": 1316229352
},
{
"pid": "<0.1303.0>",
"replication_id": "1447443f5d0837538c771c3af68518eb+create_target",
"checkpointed_source_seq": 17333,
"continuous": false,
"doc_write_failures": 0,
"docs_read": 17833,
"docs_written": 17833,
"missing_revisions_found": 17833,
"progress": 3,
"revisions_checked": 17833,
"source": "http://fdmanana.iriscouch.com/indexer_test/",
"source_seq": 551202,
"started_on": 1316229471,
"target": "indexer_test",
"type": "replication",
"updated_on": 1316230082
},
{
"pid":"<0.19211.43>",
"changes_done":4108,
"database":"compaction_test",
"progress":26,
"started_on":1344535100,
"total_changes":15344,
"type":"database_compaction",
"updated_on":1344535102
}
]The progress field is an integer in the range 0 to 100. The values for the fields started_on and updated_on corresponds to unix timestamps.