This page was generated
July 7, 2010
4:04 PM
XQuery Built-In and Modules Function Reference

Built-In: Server Monitoring

The Server Monitoring built-in functions include functions that provide monitoring information about internal conditions of MarkLogic Server and includes the xdmp:request-cancel function which is used to cancel a running request.
Function Summary
xdmp:forest-counts Returns detailed forest statistics for a given forest.
xdmp:forest-status Returns the status of a forest.
xdmp:host-status Returns the status of a host.
xdmp:request-cancel Cancel the request with the given host, server, and request IDs.
xdmp:request-status Returns the status of a running request.
xdmp:server-status Returns the status of an app-server on a host.
Function Detail
xdmp:forest-counts(
$forest-id as xs:unsignedLong,
[$show-elements as xs:string*]
)  as  element(forest-counts)
Summary:

Returns detailed forest statistics for a given forest. This built-in may require significantly more processing time than xdmp:forest-status.

Parameters:
$forest-id : A forest id.
$show-elements (optional): The names of a elements to be returned (the element names are listed in the Usage Notes below). Only the top-level elements that show counts are allowed (for example, stands-counts or document-count). The function will only perform the computations necessary to return the nodes specified. If this parameter is not specified, then all statistics are calculated and returned for the forest. For each element name, you can specify a trailing * for wildcard matching. Specifying a * with no other text forces all calculations and returns all of the nodes.

Required Privilege:

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


Usage Notes:

The structure of the XML node returned is as follows:

forest-id
The unique key of the forest.
forest-name
The forest name.
current-time
The current time.
error
The error in processing forest status.
stands-counts
The counts of stands.

This is a complex element with the following element children:

stand-counts
The stand's counts.

This is a complex element with the following element children:

stand-id
The unique key of a stand.
path
The path of the stand.
active-fragment-count
The number of fragments.
nascent-fragment-count
The number of nascent fragments.
deleted-fragment-count
The number of deleted fragments.
document-count
The number of documents in the forest.
directory-count
The number of directories in the forest.
reindex-refragment-fragment-count
The number of fragments that need to be reindexed or refragmented.
reindex-refragment-rate
The rate of reindexing/refragmenting.
forced-reindex-fragment-count
The number of fragments that need to be reindexed due for forced reindexing.
reindex-fragment-count
The number of fragments that need to be reindexed.
reindex-previous-versions-count
The number of fragments that need previous versions (used with point-in-time queries) reindexed.
reindex-stemmed-searches-count
The number of fragments that need basic stemmed search reindexed.
reindex-word-searches-count
The number of fragments that need word searches reindexed.
reindex-one-character-searches-count
The number of fragments that need one-character searches reindexed.
reindex-two-character-searches-count
The number of fragments that need two-character searches reindexed.
reindex-three-character-searches-count
The number of fragments that need three-character searches reindexed.
reindex-fast-phrase-searches-count
The number of fragments that need fast phrase searches reindexed.
reindex-fast-case-sensitive-searches-count
The number of fragments that need fast case-sensitive searches reindexed.
reindex-fast-element-word-searches-count
The number of fragments that need element word searches reindexed.
reindex-fast-element-phrase-searches-count
The number of fragments that need element phrase searches reindexed.
reindex-fast-element-character-searches-count
The number of fragments that need element character searches reindexed.
reindex-fast-element-trailing-wildcard-searches-count
The number of fragments that need element trailing wildcard searches reindexed.
reindex-word-positions-count
The number of fragments that need word positions reindexed.
reindex-element-word-positions-count
The number of fragments that need element word positions reindexed.
reindex-element-value-positions-count
The number of fragments that need element value positions reindexed.
reindex-attribute-value-positions-count
The number of fragments that need attribute value positions reindexed.
reindex-three-character-word-positions-count
The number of fragments that need three character word positions reindexed.
reindex-trailing-wildcard-searches-count
The number of fragments that need trailing wildcard searches reindexed.
reindex-trailing-wildcard-word-positions-count
The number of fragments that need trailing wildcard word positions reindexed.
reindex-fast-diacritic-sensitive-searches-count
The number of fragments that need fast diacritic-sensitive searches reindexed.
reindex-word-lexicon-count
The number of fragments that need the word lexicon reindexed.
reindex-deleted-stemmed-searches-count
The number of fragments that need the stemmed search indexes deleted.
reindex-deleted-word-searches-count
The number of fragments that need the word search indexes deleted.
reindex-deleted-one-character-searches-count
The number of fragments that need the one-character search indexes deleted.
reindex-deleted-two-character-searches-count
The number of fragments that need the two-character search indexes deleted.
reindex-deleted-three-character-searches-count
The number of fragments that need the three-character search indexes deleted.
reindex-deleted-fast-phrase-searches-count
The number of fragments that need the fast phrase search indexes deleted.
reindex-deleted-fast-case-sensitive-searches-count
The number of fragments that need the fast case-sensitive search indexes deleted.
reindex-deleted-fast-element-word-searches-count
The number of fragments that need the element word search indexes deleted.
reindex-deleted-fast-element-phrase-searches-count
The number of fragments that need the element phrase search indexes deleted.
reindex-deleted-fast-element-character-searches-count
The number of fragments that need the element character search indexes deleted.
reindex-deleted-fast-element-trailing-wildcard-searches-count
The number of fragments that need the element trailing wildcard search indexes deleted.
reindex-deleted-word-positions-count
The number of fragments that need the word position indexes deleted.
reindex-deleted-element-word-positions-count
The number of fragments that need the element word position indexes deleted.
reindex-deleted-element-value-positions-count
The number of fragments that need the element value position indexes deleted.
reindex-deleted-attribute-value-positions-count
The number of fragments that need the attribute value position indexes deleted.
reindex-deleted-three-character-word-positions-count
The number of fragments that need the three-character word position indexes deleted.
reindex-deleted-trailing-wildcard-searches-count
The number of fragments that need the trailing wildcard search indexes deleted.
reindex-deleted-trailing-wildcard-word-positions-count
The number of fragments that need the trailing wildcard word position indexes deleted.
reindex-deleted-fast-diacritic-sensitive-searches-count
The number of fragments that need the diacritic-sensitive search indexes deleted.
reindex-uri-lexicon-count
The number of fragments that need the URI lexicon reindexed.
reindex-deleted-uri-lexicon-count
The number of fragments that need the URI lexicons deleted.
reindex-collection-lexicon-count
The number of fragments that need the collection lexicon reindexed.
reindex-deleted-collection-lexicon-count
The number of fragments that need the collection lexicons deleted.
reindex-element-word-query-throughs
The reindexing of word query throughs.

This is a complex element with the following element children:

reindex-element-word-query-through
The reindexing of an element word query through.

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-phrase-throughs
The reindexing of phrase throughs.

This is a complex element with the following element children:

reindex-phrase-through
The reindexing of a phrase through.

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-phrase-arounds
The reindexing of phrase arounds.

This is a complex element with the following element children:

reindex-phrase-around
The reindexing of a phrase around.

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-range-element-indexes
The reindexing of range element-indexes.

This is a complex element with the following element children:

reindex-range-element-index
The reindexing of a range element index

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
scalar-type
The scalar type of a range index.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-range-element-attribute-indexes
The reindexing of range element attribute indexes.

This is a complex element with the following element children:

reindex-range-element-attribute-index
The reindexing of a range element attribute index

This is a complex element with the following element children:

parent-namespace-uri
A namespace URI.
parent-localname
One or more localnames.
namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-deleted-range-indexes
The reindexing of removed range indexes.

This is a complex element with the following element children:

fragment-count
The total number of fragments for a given reindexing activity.
reindex-element-word-lexicons
The reindexing of element word lexicons.

This is a complex element with the following element children:

reindex-element-word-lexicon
The reindexing of an element word lexicon

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-element-attribute-word-lexicons
The reindexing of element attribute word lexicons.

This is a complex element with the following element children:

reindex-element-attribute-word-lexicon
The reindexing of an element attribute word lexicon

This is a complex element with the following element children:

parent-namespace-uri
A namespace URI.
parent-localname
One or more localnames.
namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-all-deleted-word-lexicons
The reindexing of removed word lexicons.

This is a complex element with the following element children:

fragment-count
The total number of fragments for a given reindexing activity.
reindex-geospatial-element-indexes
The reindexing of geospatial element indexes.

This is a complex element with the following element children:

reindex-geospatial-element-index
The reindexing of a geospatial element index

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-geospatial-element-child-indexes
The reindexing of geospatial element child indexes.

This is a complex element with the following element children:

reindex-geospatial-element-child-index
The reindexing of a geospatial element child index

This is a complex element with the following element children:

parent-namespace-uri
A namespace URI.
parent-localname
One or more localnames.
namespace-uri
A namespace URI.
localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-geospatial-element-pair-indexes
The reindexing of geospatial element pair indexes.

This is a complex element with the following element children:

reindex-geospatial-element-pair-index
The reindexing of a geospatial element pair index.

This is a complex element with the following element children:

parent-namespace-uri
A namespace URI.
parent-localname
One or more localnames.
latitude-namespace-uri
A namespace URI.
latitude-localname
One or more localnames.
longitude-namespace-uri
A namespace URI.
longitude-localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
reindex-geospatial-element-attribute-pair-indexes
The reindexing of geospatial element indexes.

This is a complex element with the following element children:

reindex-geospatial-element-attribute-pair-index
The reindexing of a geospatial element attribute pair index.

This is a complex element with the following element children:

parent-namespace-uri
A namespace URI.
parent-localname
One or more localnames.
latitude-namespace-uri
A namespace URI.
latitude-localname
One or more localnames.
longitude-namespace-uri
A namespace URI.
longitude-localname
One or more localnames.
reindex-fragment-count
The number of fragments that need to be reindexed.
fragment-count
The total number of fragments for a given reindexing activity.
refragment-document-count
The number of documents that need to be refragmented.
refragment-fragment-roots
The refragmenting of fragment roots.

This is a complex element with the following element children:

refragment-fragment-parent
The refragmenting of fragment parent.

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
refragment-document-count
The number of documents that need to be refragmented.
document-count
The number of documents in the forest.
refragment-fragment-parents
The refragmenting of fragment parents.

This is a complex element with the following element children:

refragment-fragment-parent
The refragmenting of fragment parent.

This is a complex element with the following element children:

namespace-uri
A namespace URI.
localname
One or more localnames.
refragment-document-count
The number of documents that need to be refragmented.
document-count
The number of documents in the forest.
refragment-new-fields
The refragmenting of new fields.

This is a complex element with the following element children:

refragment-new-field
The refragmenting of a new field.

This is a complex element with the following element children:

field-name
The Field Name.
refragment-document-count
The number of documents that need to be refragmented.
document-count
The number of documents in the forest.
refragment-modified-fields
The refragmenting of modifiedfields.

This is a complex element with the following element children:

refragment-modified-field
The refragmenting of a new field.

This is a complex element with the following element children:

field-name
The Field Name.
refragment-document-count
The number of documents that need to be refragmented.
document-count
The number of documents in the forest.
refragment-removed-configurations
Refragmenting old fragment root/parent settings

This is a complex element with the following element children:

refragment-document-count
The number of documents that need to be refragmented.
reindex-reverse-searches-fragment-count
The number of fragments that need to be reindexed for reverse searches.

Example:
xdmp:forest-counts(xdmp:forest("Documents"))
=>
<forest-counts xmlns="http://marklogic.com/xdmp/status/forest">
  <forest-id>12434840716430044697</forest-id>
  <current-time>2007-02-16T19:00:00.708-08:00</current-time>
  <stands-counts>
    <stand-counts>
      <stand-id>15174447282968484759</stand-id>
      <path>c:\Program Files\MarkLogic\Data\Forests\Documents\00000016</path>
      <active-fragment-count>146</active-fragment-count>
      <nascent-fragment-count>0</nascent-fragment-count>
      <deleted-fragment-count>0</deleted-fragment-count>
    </stand-counts>
  </stands-counts>
  <document-count>67</document-count>
  <directory-count>3</directory-count>
</forest-counts>
 
Example:
(: only calculate the document count :)
xdmp:forest-counts(xdmp:forest("Documents"), ("document-count"))
=>
<forest-counts xmlns="http://marklogic.com/xdmp/status/forest">
  <forest-id>11656884323633926637</forest-id>
  <forest-name>Documents</forest-name>
  <current-time>2008-03-18T16:22:34.082-07:00</current-time>
  <document-count>1070</document-count>
</forest-counts>

 
Example:
(: force everything to be calculated :)
xdmp:forest-counts(xdmp:forest("Documents"), "*")
=>
 the full output of xdmp:forest-counts

 
Example:
(: show the counts of everything that needs to be reindexed  :)
xdmp:forest-counts(xdmp:forest("Documents"), "reindex*")
=>
<forest-counts xmlns="http://marklogic.com/xdmp/status/forest">
  <forest-id>11656884323633926637</forest-id>
  <forest-name>Documents</forest-name>
  <current-time>2008-03-18T18:07:47.57-07:00</current-time>
  <reindex-refragment-fragment-count>0</reindex-refragment-fragment-count>
  <reindex-refragment-rate>0</reindex-refragment-rate>
  <reindex-fragment-count>0</reindex-fragment-count>
  ......
  ..... all of the other reindex* elements
  ......
</forest-counts>

 

xdmp:forest-status(
$forest-id as xs:unsignedLong
)  as  element(forest-status)
Summary:

Returns the status of a forest.

Parameters:
$forest-id : A forest id.

Required Privilege:

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

Usage Notes:

The structure of the XML node returned is as follows:

forest-id
The unique key of the forest.
forest-name
The forest name.
host-id
The unique key of the host that mounts the forest
state
The state of the forest.
error
The error in processing forest status.
database-id
The database the forest belongs to.
last-state-change
The last time the forest state changed.
journals-size
The amount of space the journals take up on disk.
stands
The stands in the forest.

This is a complex element with the following element children:

stand
The stand of a forest.

This is a complex element with the following element children:

stand-id
The unique key of a stand.
path
The path of the stand.
stand-kind
The kind of stand.
label-version
The version number of the label file.
disk-size
The amount of space the stand takes on disk.
memory-size
The amount of space the stand takes in memory.
list-cache-hits
The number of hits on the list cache.
list-cache-misses
The number of misses on the list cache.
list-cache-hit-rate
The average number of hits on the list cache.
list-cache-miss-rate
The average number of misses on the list cache.
compressed-tree-cache-hits
The number of hits on the compressed cache.
compressed-tree-cache-misses
The number of misses on the compressed cache.
compressed-tree-cache-hit-rate
The average number of hits on the compressed cache.
compressed-tree-cache-miss-rate
The average number of misses on the compressed cache.
current-time
The current time.
merges
The merges in progress on the forest.

This is a complex element with the following element children:

merge
The merge of two stands in a forest.

This is a complex element with the following element children:

merge-id
A unique key for a merge.
canceled
Is a merge canceled or not.
input-stands
The input stands of a merge.
path
The path of the stand.
output-stand
The id of a stand resulting from a merge.
start-time
The time a merge started.
final-size
The estimated final size of a stand.
current-size
The current size of a merging stand.
merge-rate
The rate of a merge (MB/sec).
reindexing
Is this forest reindexing.
device-space
The amount of space left on forest device.
last-backup
The last time the forest was backed up.
last-restore
The last time the forest was restored.
backups
The backups in progress on the forest.

This is a complex element with the following element children:

backup
The backup of a forest.

This is a complex element with the following element children:

path
The path of the stand.
start-time
The time a merge started.
final-size
The estimated final size of a stand.
current-size
The current size of a merging stand.
restore
The restore of a forest.

This is a complex element with the following element children:

path
The path of the stand.

start-time
The time a merge started.

final-size
The estimated final size of a stand.

current-size
The current size of a merging stand.

restore-state
The state of the forest restore.
transaction-coordinators
The set of transactions that this forest is coordinating.

This is a complex element with the following element children:

transaction-coordinator
A transaction that this forest is coordinating.

This is a complex element with the following element children:

transaction-id
The unique key of the transaction.
decision-state
The state of the transaction.
participants
The set of participating transactions.
transaction-participants
The set of transactions that this forest is participating in.

This is a complex element with the following element children:

transaction-participant
A transaction that this forest is participating in.

This is a complex element with the following element children:

transaction-id
The unique key of the transaction.
coordinator-id
The forest id of the coordinator of a transaction.

Example:
xdmp:forest-status(xdmp:forest("Documents"))
=>
<forest-status xmlns="http://marklogic.com/xdmp/status/forest">
  <forest-id>12434840716430044697</forest-id>
  <forest-name>Documents</forest-name>
  <state>open</state>
  <host-id>13264574555735898770</host-id>
  <database-id>2634450243966805432</database-id>
  <last-state-change>2007-02-16T18:39:31.267-08:00</last-state-change>
  <journals-size>57</journals-size>
  <stands>
    <stand>
      <stand-id>15174447282968484759</stand-id>
      <path>c:\Program Files\MarkLogic\Data\Forests\Documents\00000016</path>
      <stand-kind>Active</stand-kind>
      <label-version>50397184</label-version>
      <disk-size>11</disk-size>
      <memory-size>1</memory-size>
      <list-cache-hits>158</list-cache-hits>
      <list-cache-misses>105</list-cache-misses>
      <list-cache-hit-rate>0</list-cache-hit-rate>
      <list-cache-miss-rate>0</list-cache-miss-rate>
      <compressed-tree-cache-hits>0</compressed-tree-cache-hits>
      <compressed-tree-cache-misses>0</compressed-tree-cache-misses>
      <compressed-tree-cache-hit-rate>0</compressed-tree-cache-hit-rate>
      <compressed-tree-cache-miss-rate>0</compressed-tree-cache-miss-rate>
    </stand>
  </stands>
  <current-time>2007-02-16T18:44:06.154-08:00</current-time>
  <merges/>
  <reindexing>false</reindexing>
  <device-space>3592</device-space>
  <backups/>
  <transaction-coordinators/>
  <transaction-participants/>
</forest-status>

xdmp:host-status(
$host-id as xs:unsignedLong
)  as  element(host-status)
Summary:

Returns the status of a host.

Parameters:
$host-id : A host id.

Required Privilege:

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

Usage Notes:

The structure of the XML node returned is as follows:

host-id
The unique ID of a host.
error
The error in processing host status.
host-name
The internet host name.
group-id
The group the host belongs to.
current-time
The current time.
last-startup
The timestamp of last host startup
version
The version of the product.
architecture
The achitecture of the product.
license-key
The license key for this host.
licensee
The host licensee.
license-key-expires
When does the license key for this host expire.
license-key-cpus
How many cpus does this license key support.
license-key-cores
How many cores does this license key support.
license-key-size
What size database does this license key support.
license-key-options
The options that this host's license key provides.

This is a complex element with the following element children:

license-key-option
A license key option.
pre-release-expires
When does the pre-release for this host expire.
accepted-version
The last accepted version.
accepted-agreement
The last accepted agreement.
accepted-licensee
The last accepted licensee.
edition
The edition of this host.
cpus
The number of CPUs.
cores
The number of cores.
host-size
The total data size of the host.
log-device-space
The number of MB left on log device.
data-dir-space
The number of MB left on data dir.
config-file-timestamps
The timestamps of the host's config files.

This is a complex element with the following element children:

groups-timestamp
The timestamp of the groups config file.

hosts-timestamp
The timestamp of the hosts config file.

databases-timestamp
The timestamp of the databases config file.

assignments-timestamp
The timestamp of the assignments config file.

tokenizer-timestamp
The timestamp of the tokenizer config file.

mimetypes-timestamp
The timestamp of the mimetypes config file.
http-servers
The HTTP servers running on the host.

This is a complex element with the following element children:

http-server
The HTTP server running on a host.

This is a complex element with the following element children:

http-server-id
The HTTP server id.
port
The server socket bind internet port number.
webDAV
webDAV server versus HTTP server.
xdbc-servers
The XDBC servers running on the host.

This is a complex element with the following element children:

xdbc-server
The XDBC server running on a host.

This is a complex element with the following element children:

xdbc-server-id
The XDBC server id.
port
The server socket bind internet port number.
task-server
The task server on a host.

This is a complex element with the following element children:

task-server-id
The task server id.
assignments
Forest assignments as the host sees them.

This is a complex element with the following element children:

assignment
The forest configuration as seen by the host.

This is a complex element with the following element children:

forest-name
The forest name.
host-id
The unique ID of a host.
forest-id
The unique id of the forest.
hosts
The host's view of all other hosts in the cluster.

This is a complex element with the following element children:

host
The host connection information

This is a complex element with the following element children:

host-id
The unique ID of a host.
host-name
The internet host name.
connect-port
The distributed protocol client socket connect internet port number.
online
Is this host seen as online? (true for online)
last-online
The time the host went online.
last-offline
The time the host went offline.
bind-port
The distributed protocol server socket bind internet port number.
backup-jobs
The backup jobs the host is processing.

This is a complex element with the following element children:

backup-job
The backup job.

This is a complex element with the following element children:

job-id
The unique ID of a job.
path
The path of the stand.
start-time
The time a backup or restore started.
forests
The forests in a backup/restore job
restore-jobs
The restore jobs the host is processing.

This is a complex element with the following element children:

restore-job
The restore job.

This is a complex element with the following element children:

job-id
The unique ID of a job.
path
The path of the stand.
start-time
The time a backup or restore started.
forests
The forests in a backup/restore job
compressed-tree-cache-partitions
The compressed-tree cache partitions on the host.

This is a complex element with the following element children:

compressed-tree-cache-partition
The compressed-tree cache partition.

This is a complex element with the following element children:

partition-size
The size of a cache partition, in megabytes.
partition-table
The percentage of the table for a cache partition that is currently used.
partition-used
The percentage of the space in a cache partition that is currently used.
partition-free
The percentage of the space in a cache partition that is currently free.
partition-overhead
The percentage of the space in a cache partition that is currently overhead.
expanded-tree-cache-partitions
The expanded-tree cache partitions on the host.

This is a complex element with the following element children:

expanded-tree-cache-partition
The expanded-tree cache partition.

This is a complex element with the following element children:

partition-size
The size of a cache partition, in megabytes.
partition-table
The percentage of the table for a cache partition that is currently used.
partition-busy
The percentage of the space in a cache partition that is currently used and cannot be freed.
partition-used
The percentage of the space in a cache partition that is currently used.
partition-free
The percentage of the space in a cache partition that is currently free.
partition-overhead
The percentage of the space in a cache partition that is currently overhead.
list-cache-partitions
The list cache partitions on the host.

This is a complex element with the following element children:

list-cache-partition
The list cache partition.

This is a complex element with the following element children:

partition-size
The size of a cache partition, in megabytes.
partition-table
The percentage of the table for a cache partition that is currently used.
partition-busy
The percentage of the space in a cache partition that is currently used and cannot be freed.
partition-used
The percentage of the space in a cache partition that is currently used.
partition-free
The percentage of the space in a cache partition that is currently free.
partition-overhead
The percentage of the space in a cache partition that is currently overhead.

The information returned from xdmp:host-status is always computed on the host specified in the $host-id parameter, even if the call is evaluated on an App Server running on a different host. That is, when the API call is issued, MarkLogic Server communicates with the specified host for the its status and returns the staus from the perspective of the specified host (not from the perspective of the host in which the XQuery API is evaluated).


Example:
xdmp:host-status(xdmp:host("raymond.marklogic.com"))
=>
<host-status xmlns="http://marklogic.com/xdmp/status/host">
  <host-id>13264574555735898770</host-id>
  <host-name>raymond.marklogic.com</host-name>
  <group-id>18323836549784872587</group-id>
  <current-time>2007-02-16T18:50:43.422-08:00</current-time>
  <bind-port>7999</bind-port>
  <connect-port>7999</connect-port>
  <last-startup>2007-02-16T18:39:00.642-08:00</last-startup>
  <version>3.2-20070214</version>
  <architecture>i686</architecture>
  <license-key>ABC-123-XYZ</license-key>
  <licensee>Raymond - Mark Logic</licensee>
  <license-key-expires>2007-04-14T00:00:00-08:00</license-key-expires>
  <license-key-cpus>2</license-key-cpus>
  <license-key-cores>4</license-key-cores>
  <license-key-size>0</license-key-size>
  <license-key-options>
    <license-key-option>conversion</license-key-option>
    <license-key-option>failover</license-key-option>
    <license-key-option>French</license-key-option>
    <license-key-option>German</license-key-option>
    <license-key-option>Italian</license-key-option>
    <license-key-option>Spanish</license-key-option>
    <license-key-option>Russian</license-key-option>
    <license-key-option>Arabic</license-key-option>
    <license-key-option>Simplified Chinese</license-key-option>
    <license-key-option>English</license-key-option>
  </license-key-options>
  <pre-release-expires>2007-05-15T05:08:59-08:00</pre-release-expires>
  <accepted-version>3.2-20070214</accepted-version>
  <accepted-agreement>development</accepted-agreement>
  <accepted-licensee>Raymond - Mark Logic</accepted-licensee>
  <edition>Enterprise</edition>
  <cpus>1</cpus>
  <cores>1</cores>
  <host-size>197</host-size>
  <log-device-space>3592</log-device-space>
  <data-dir-space>3592</data-dir-space>
  <config-file-timestamps>
    <groups-timestamp>1978290846354</groups-timestamp>
    <hosts-timestamp>354793208466</hosts-timestamp>
    <databases-timestamp>1995470715538</databases-timestamp>
    <assignments-timestamp>1832261958290</assignments-timestamp>
    <tokenizer-timestamp>0</tokenizer-timestamp>
    <mimetypes-timestamp>0</mimetypes-timestamp>
  </config-file-timestamps>
  <http-servers>
    <http-server>
      <http-server-id>15847393982828089978</http-server-id>
      <port>9032</port>
      <webDAV>true</webDAV>
    </http-server>
    <http-server>
      <http-server-id>17360064376275143119</http-server-id>
      <port>8000</port>
      <webDAV>false</webDAV>
    </http-server>
    <http-server>
      <http-server-id>4492507232107144149</http-server-id>
      <port>8001</port>
      <webDAV>false</webDAV>
    </http-server>
  </http-servers>
  <xdbc-servers>
    <xdbc-server>
      <xdbc-server-id>4057681084273905496</xdbc-server-id>
      <port>8021</port>
    </xdbc-server>
    <xdbc-server>
      <xdbc-server-id>6086706739056900422</xdbc-server-id>
      <port>8050</port>
    </xdbc-server>
  </xdbc-servers>
  <task-server>
    <task-server-id>10441203546898933382</task-server-id>
  </task-server>
  <assignments>
    <assignment>
      <forest-name>bill</forest-name>
      <forest-id>11413686728343849399</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
    <assignment>
      <forest-name>Security</forest-name>
      <forest-id>11436840116662532973</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
    <assignment>
      <forest-name>Triggers</forest-name>
      <forest-id>6800799099781840925</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
    <assignment>
      <forest-name>Documents</forest-name>
      <forest-id>12434840716430044697</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
    <assignment>
      <forest-name>test</forest-name>
      <forest-id>8050247748004050993</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
    <assignment>
      <forest-name>Modules</forest-name>
      <forest-id>2413699485643173169</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
    <assignment>
      <forest-name>Schemas</forest-name>
      <forest-id>6668879474270284963</forest-id>
      <host-id>13264574555735898770</host-id>
    </assignment>
  </assignments>
  <hosts>
    <host>
      <host-id>13264574555735898770</host-id>
      <host-name>raymond.marklogic.com</host-name>
      <connect-port>7999</connect-port>
      <online>true</online>
    </host>
  </hosts>
  <backup-jobs/>
  <restore-jobs/>
  <compressed-tree-cache-partitions>
    <compressed-tree-cache-partition>
      <partition-size>32</partition-size>
      <partition-table>53.9</partition-table>
      <partition-used>46.2</partition-used>
      <partition-free>53</partition-free>
      <partition-overhead>0.8</partition-overhead>
    </compressed-tree-cache-partition>
  </compressed-tree-cache-partitions>
  <expanded-tree-cache-partitions>
    <expanded-tree-cache-partition>
      <partition-size>32</partition-size>
      <partition-table>81.2</partition-table>
      <partition-busy>0</partition-busy>
      <partition-used>89.7</partition-used>
      <partition-free>6.2</partition-free>
      <partition-overhead>4.1</partition-overhead>
    </expanded-tree-cache-partition>
  </expanded-tree-cache-partitions>
  <list-cache-partitions>
    <list-cache-partition>
      <partition-size>32</partition-size>
      <partition-table>0.1</partition-table>
      <partition-busy>0</partition-busy>
      <partition-used>0.1</partition-used>
      <partition-free>99.9</partition-free>
      <partition-overhead>0</partition-overhead>
    </list-cache-partition>
  </list-cache-partitions>
</host-status>

xdmp:request-cancel(
$hostID as xs:unsignedLong,
$serverID as xs:unsignedLong,
$requestID as xs:unsignedLong
)  as  empty-sequence()
Summary:

Cancel the request with the given host, server, and request IDs.

Parameters:
$hostID : The ID of the host on which the request is running. Typically, you get the ID of a host by executing code similar to:
    xdmp:host("myhost")
$serverID : The ID of the App Server in which the request is running. Typically, you get the ID of an App Server by executing code similar to:
    xdmp:server("myAppServerName")
$requestID : The ID of the request. You can access the request IDs in the request elements of the xdmp:server-status output. You get the request ID by executing code similar to:
    declare namespace status=
        "http://marklogic.com/xdmp/status/server"
    
    xdmp:server-status( xdmp:host("myhost"), 
      xdmp:server("myAppServerName") )//status:request

Required Privilege:

http://marklogic.com/xdmp/privileges/xdmp-request-cancel and http://marklogic.com/xdmp/privileges/cancel-any-request or http://marklogic.com/xdmp/privileges/cancel-my-requests


Usage Notes:

To find out the status of the request after it has been canceled, you can call xdmp:server-status, which has information about each request active or being canceled on the server. Once a request has completed canceling, it will no longer appear in the output of xdmp:server-status.


Example:
  xdmp:request-cancel(xdmp:host("myhost"), 
                      xdmp:server("myAppServerName"),
		      98394839084390843)
   => ()

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, webDAV, or Task).
$request-id : A request ID.

Required Privilege:

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

Usage Notes:

The structure of the XML node 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
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.
root
The root document directory pathname.
request-kind
The kind of request (for example, invoke, eval).
request-text
The request text.
update
Specifies if this request an update (true for update requests).
start-time
The time the operation started.
client-address
The network address of a client
user
The unique ID of the user executing the request.
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.
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.
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>6421977735636900809</request-id>
  <server-id>6693979901326946703</server-id>
  <host-id>2612493919508853477</host-id>
  <canceled>false</canceled>
  <modules>0</modules>
  <database>5184170867299910410</database>
  <root>c:/ml-danny\</root>
  <request-kind>invoke</request-kind>
  <request-text>/cq/eval.xqy?iefix.txt</request-text>
  <update>false</update>
  <start-time>2008-06-09T16:08:43.681-07:00</start-time>
  <time-limit>600</time-limit>
  <max-time-limit>1440</max-time-limit>
  <user>893641342095093063</user>
  <client-address>127.0.0.1</client-address>
  <trigger-depth>0</trigger-depth>
  <expanded-tree-cache-hits>0</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>
</request-status>


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

Returns the status of an app-server on a host.

Parameters:
$host-id : A host id.
$server-id : A server id (HTTP, XDBC, webDAV, or Task).

Required Privilege:

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

Usage Notes:

The structure of the XML node returned is as follows:

server-id
The server id.
host-id
The unique key of the host
error
The error in processing server status.
server-name
The server name.
server-kind
The kind of server
port
The server socket bind internet port number.
root
The root document directory pathname.
modules
The ID of the database that contains application modules. If on the file-system, then 0.
database
The ID of the content database.
address
The server socket bind numeric internet address.
backlog
The socket listen backlog.
threads
The maximum number of server threads allowed.
max-threads
The maximum number of server threads allowed.
request-timeout
The request socket recv timeout, in seconds.
keep-alive-timeout
The keep-alive socket recv timeout, in seconds.
session-timeout
The session expiration timeout, in seconds.
static-expires
The static content expiration interval, in seconds.
max-time-limit
The upper bound for a request's time limit, in seconds.
default-time-limit
The default time limit for a request, in seconds.
authentication
The authentication scheme to use for this server
default-user
The user used as the default user in application level authentication. Using the admin user as the default user is equivalent to turning security off.
privilege
The privilege restricting access to the server.
default-xquery-version
An application server's default XQuery language version.
current-time
The current time.
request-statuses
The requests being processed by the server.

This is a complex element with the following element children:

request-status
The request being processed by the server.

This is a complex element with the following element children:

request-id
A unique id for a request.
server-id
The server id.
host-id
The unique key of the host
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.
root
The root document directory pathname.
request-kind
The kind of request (for example, invoke, eval).
request-text
The request text.
update
Specifies if this request an update (true for update requests).
start-time
The time the operation started.
client-address
The network address of a client
user
The unique ID of the user executing the request.
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.
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.
expr-id
The expression id.
where-stopped
Where the request is stopped.
request-rate
The rate of a request (requests/sec).
queue-size
The number of tasks in the server queue.
queue-limit
The maximum number size of the queue.
open-sockets
The number of open sockets
expanded-tree-cache-hits
The number of hits on the expanded cache.
expanded-tree-cache-misses
The number of misses on the expanded cache.
expanded-tree-cache-hit-rate
The average number of hits on the expanded cache.
expanded-tree-cache-miss-rate
The average number of misses on the expanded cache.
fs-program-cache-hits
The number of hits on the filesystem program cache.
fs-program-cache-misses
The number of misses on the filesystem program cache.
db-program-cache-hits
The number of hits on the database program cache.
db-program-cache-misses
The number of misses on the database program cache.
fs-main-module-seq-cache-hits
The number of hits on the filesystem main module sequence cache.
fs-main-module-seq-cache-misses
The number of misses on the filesystem main module sequence cache.
db-main-module-seq-cache-hits
The number of hits on the database main module sequence cache.
db-main-module-seq-cache-misses
The number of misses on the database main module sequence cache.
fs-lib-module-cache-hits
The number of hits on the filesystem library module cache.
fs-lib-module-cache-misses
The number of misses on the filesystem library module cache.
db-lib-module-cache-hits
The number of hits on the database library module cache.
db-lib-module-cache-misses
The number of misses on the database library module cache.

Example:
xdmp:server-status(xdmp:host(),xdmp:server("Admin"))
=>

<server-status xmlns="http://marklogic.com/xdmp/status/server">
  <server-id>4492507232107144149</server-id>
  <server-name>Admin</server-name>
  <host-id>13264574555735898770</host-id>
  <server-kind>http-server</server-kind>
  <port>8009</port>
  <root>Admin\</root>
  <modules>0</modules>
  <database>5496769417926491762</database>
  <last-login>9823948029384029384</last-login>
  <display-last-login>true</display-last-login>
  <backlog>256</backlog>
  <threads>2</threads>
  <max-threads>32</max-threads>
  <request-timeout>30</request-timeout>
  <keep-alive-timeout>5</keep-alive-timeout>
  <session-timeout>3600</session-timeout>
  <max-time-limit>3600</max-time-limit>
  <default-time-limit>600</default-time-limit>
  <authentication>basic</authentication>
  <default-user>8216129598321388485</default-user>
  <privilege>0</privilege>
  <default-xquery-version>1.0-ml</default-xquery-version>
  <current-time>2007-03-29T14:43:00.819-07:00</current-time>
  <request-statuses>
    <request-status>
      <request-id>15629296310429871822</request-id>
      <server-id>4492507232107144149</server-id>
      <host-id>13264574555735898770</host-id>
      <canceled>false</canceled>
      <modules>0</modules>
      <database>5496769417926491762</database>
      <root>Admin\</root>
      <request-kind>invoke</request-kind>
      <request-text>/cluster-status.xqy</request-text>
      <update>false</update>
      <start-time>2007-03-29T14:42:52.905-07:00</start-time>
      <user>8216129598321388485</user>
      <client-address>127.0.0.1</client-address>
      <trigger-depth>0</trigger-depth>
      <expanded-tree-cache-hits>0</expanded-tree-cache-hits>
      <expanded-tree-cache-misses>0</expanded-tree-cache-misses>
      <request-state>running</request-state>
      <profiling-allowed>false</profiling-allowed>
      <profiling-enabled>false</profiling-enabled>
      <debugging-allowed>false</debugging-allowed>
      <debugging-status>detached</debugging-status>
    </request-status>
  </request-statuses>
  <request-rate>0.0639857</request-rate>
  <open-sockets/>
  <expanded-tree-cache-hits>759</expanded-tree-cache-hits>
  <expanded-tree-cache-misses>185</expanded-tree-cache-misses>
  <expanded-tree-cache-hit-rate>0.272918</expanded-tree-cache-hit-rate>
  <expanded-tree-cache-miss-rate>0</expanded-tree-cache-miss-rate>
  <fs-program-cache-hits>9</fs-program-cache-hits>
  <fs-program-cache-misses>40</fs-program-cache-misses>
  <db-program-cache-hits>0</db-program-cache-hits>
  <db-program-cache-misses>0</db-program-cache-misses>
  <fs-main-module-seq-cache-hits>0</fs-main-module-seq-cache-hits>
  <fs-main-module-seq-cache-misses>19</fs-main-module-seq-cache-misses>
  <db-main-module-seq-cache-hits>0</db-main-module-seq-cache-hits>
  <db-main-module-seq-cache-misses>0</db-main-module-seq-cache-misses>
  <fs-lib-module-cache-hits>412</fs-lib-module-cache-hits>
  <fs-lib-module-cache-misses>23</fs-lib-module-cache-misses>
  <db-lib-module-cache-hits>0</db-lib-module-cache-hits>
  <db-lib-module-cache-misses>0</db-lib-module-cache-misses>
</server-status>