Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp.requestStatus

xdmp.requestStatus(
   host-id as (Number|String),
   server-id as (Number|String),
   request-id as (Number|String)[]
) as Sequence

Summary

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.toJSON(xdmp.serverStatus(xdmp.host(),xdmp.server())).xpath("//requestStatus[requestId = 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.serverStatus.

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.

Required Privileges

http://marklogic.com/xdmp/privileges/status

Usage Notes

The structure of the data returned is as follows:

requestId

A unique id for a request.

serverId

The server id.

hostId

The unique key of the host

transactionId

The unique key of the transaction

canceled

Has this request been canceled.

modules

The ID of the database that contains application modules. If on the file-system, then 0.

database

The ID of the content database when applicable. In some cases, this is a forest ID or a random number (when neither a database ID nor a forest ID is available).

root

The root document directory pathname.

requestKind

The kind of request (for example, invoke, eval).

requestText

The request text.

requestRewrittenText

The rewritten request text.

update

Specifies if this request an update (true for update requests).

startTime

The time the operation started.

timeLimit

The request's time limit, in seconds.

maxTimeLimit

The upper bound for a request's time limit, in seconds.

lockCount

The request's current limit on combined count for the number of times a read or a write lock was acquired.

readSize

The request's current limit on combined size read from disk (listSize+compressedTreeSize), in bytes.

user

The unique ID of the user executing the request.

clientAddress

The network address of a client

triggerDepth

The maximum depth of trigger invocation.

expandedTreeCacheHits

The number of hits on the expanded cache.

expandedTreeCacheMisses

The number of misses on the expanded cache.

requestState

The state of a request

profilingAllowed

Is profiling allowed for this request.

profilingEnabled

Is profiling currently enabled for this request.

debuggingAllowed

Is debugging allowed for this request.

debuggingStatus

The debugging status of the request.

retryCount

The number of retries on the request.

exprId

The expression id.

whereStopped

Where the request is stopped.

Example

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 iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.