xdmp.requestStatus( host-id as (Number|String), server-id as (Number|String), request-id as (Number|String)[] ) as Sequence
Returns the status of a running request as
a Sequence of ObjectNodes. If the request ID is that of
the calling request, then no special permission is required. If the
ID is for another request, then the calling request needs
http://marklogic.com/xdmp/privileges/status
permission.
The result of this builtin is exactly equivalent to
xdmp:server-status(xdmp:host(), xdmp:server())//*:request-status[*:request-id = $req]
,
where $req
is the ID of the request
you are interested in.
In the 3.2 release this builtin is not cluster-aware, the
first argument (host ID) must be the same as the value returned
by xdmp:host()
. If you wish to obtain the status of a request
running on a remote host, use the code snippet above to obtain
the request status using xdmp:server-status()
.
Parameters | |
---|---|
host-id | A host ID. Must be the ID of the local host. |
server-id | A server ID (HTTP, XDBC, ODBC, webDAV, or Task). |
request-id | One or more request IDs. |
The structure of the data returned is as follows:
requestId
serverId
hostId
transactionId
canceled
modules
database
root
requestKind
requestText
requestRewrittenText
update
startTime
timeLimit
maxTimeLimit
lockCount
readSize
user
clientAddress
triggerDepth
expandedTreeCacheHits
expandedTreeCacheMisses
requestState
profilingAllowed
profilingEnabled
debuggingAllowed
debuggingStatus
retryCount
exprId
whereStopped
xdmp.requestStatus(xdmp.host(), xdmp.server(), xdmp.request()); => { "requestId": "9833232389754205407", "serverId": "536121115905064034", "hostId": "2485368722774099257", "transactionId": "6714524514889161071", "canceled": false, "modules": 0, "database": "12466402192567279933", "root": "Apps/", "requestKind": "invoke", "requestText": "/qconsole/endpoints/evaljs.sjs", "requestRewrittenText": "/qconsole/endpoints/evaljs.sjs?sid= 18127344729549022960&qid=4268464128679030683&crid= 9862289152&querytype=javascript&action=eval&cache=1418875622481", "update": false, "startTime": "2014-12-17T20:07:02.496789-08:00", "timeLimit": 600, "maxTimeLimit": 3600, "lockCount":100, "readSize":100000 "user": "7071164303237443533", "clientAddress": "172.16.19.129", "triggerDepth": 0, "expandedTreeCacheHits": 0, "expandedTreeCacheMisses": 0, "requestState": "running", "profilingAllowed": true, "profilingEnabled": false, "debuggingAllowed": true, "debuggingStatus": "detached", "retryCount": 0 }
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.