MarkLogic 10 Product Documentation
xdmp:request-status

xdmp:request-status(
   $host-id as xs:unsignedLong,
   $server-id as xs:unsignedLong,
   $request-id as xs:unsignedLong*
) as element(request-status)*

Summary

Returns the status of a running request . 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.

Required Privileges

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

Usage Notes

The structure of the data returned is as follows:

request-id

A unique id for a request.

server-id

The server id.

host-id

The unique key of the host

transaction-id

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.

request-kind

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

request-text

The request text.

request-rewritten-text

The rewritten request text.

update

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

start-time

The time the operation started.

time-limit

The request's time limit, in seconds.

max-time-limit

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

lock-count

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

read-size

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.

client-address

The network address of a client

trigger-depth

The maximum depth of trigger invocation.

expanded-tree-cache-hits

The number of hits on the expanded cache.

expanded-tree-cache-misses

The number of misses on the expanded cache.

request-state

The state of a request

profiling-allowed

Is profiling allowed for this request.

profiling-enabled

Is profiling currently enabled for this request.

debugging-allowed

Is debugging allowed for this request.

debugging-status

The debugging status of the request.

retry-count

The number of retries on the request.

expr-id

The expression id.

where-stopped

Where the request is stopped.

Example

xdmp:request-status(xdmp:host(), xdmp:server(), xdmp:request())
=>
<request-status xmlns="http://marklogic.com/xdmp/status/server">
  <request-id>17571547553153953696</request-id>
  <server-id>6979985792045178484</server-id>
  <host-id>2612493919508853477</host-id>
  <transaction-id>2978550460365092692</transaction-id>
  <canceled>false</canceled>
  <modules>0</modules>
  <database>13419866041652476886</database>
  <root>Apps/</root>
  <request-kind>invoke</request-kind>
  <request-text>/qconsole/endpoints/eval.xqy</request-text>
  <request-rewritten-text>/qconsole/endpoints/eval.xqy?sid=
     6693979901326946703&amp;resulttype=text&amp;qid=
     2507225313416696807&amp;cache=1363814207307</request-rewritten-text>
  <update>false</update>
  <start-time>2013-03-20T14:16:47.326-07:00</start-time>
  <time-limit>600</time-limit>
  <max-time-limit>1440</max-time-limit>
  <lock-count>100</lock-count>
  <read-size>100000<read-size>
  <user>893641342095093063</user>
  <client-address>127.0.0.1</client-address>
  <trigger-depth>0</trigger-depth>
  <expanded-tree-cache-hits>2</expanded-tree-cache-hits>
  <expanded-tree-cache-misses>0</expanded-tree-cache-misses>
  <request-state>running</request-state>
  <profiling-allowed>true</profiling-allowed>
  <profiling-enabled>false</profiling-enabled>
  <debugging-allowed>true</debugging-allowed>
  <debugging-status>detached</debugging-status>
  <retry-count>0</retry-count>
</request-status>
Powered by MarkLogic Server | Terms of Use | Privacy Policy