prof:report( $request-id as xs:unsignedLong ) as element(prof:report)?
Return a prof:report
node containing the current state of
profiling statistics for the given request. If profiling
has never been enabled for the request, the empty sequence
is returned.
If profiling is not allowed for the App Server, this function
returns an empty sequence.
For details on profiling requests and interpreting the output of a profile request, see Profiling Requests to Evaluate Performance in the Query Performance and Tuning Guide.
Parameters | |
---|---|
request-id |
A request ID. Use the xdmp:request() function, which
returns the request ID for the currently running request, to specify
the current request.
|
Either
http://marklogic.com/xdmp/privileges/profile-my-requests
or
http://marklogic.com/xdmp/privileges/profile-any-requests
is required for profiling requests other than the current request, with
the profile-my-requests
privilege allowing profiling of
requests issued by the same user ID, and the
profile-any-requests
privilege allowing profiling of requests
issued by any user ID. No privilege is required to profile the currently
running request (that is, self-profiling is always allowed).
(: Before running this, make sure profiling is enabled on the App Server :) prof:enable(xdmp:request()), fn:current-dateTime(), prof:report(xdmp:request()) => 2007-02-16T19:24:30.093-08:00 <prof:report xsi:schemaLocation="http://marklogic.com/xdmp/profile profile.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:prof="http://marklogic.com/xdmp/profile"> <prof:metadata> <prof:overall-elapsed>PT0S</prof:overall-elapsed> <prof:created>2007-02-16T19:24:30.093-08:00</prof:created> <prof:server-version>3.2-20070214</prof:server-version> </prof:metadata> <prof:histogram> <prof:expression> <prof:expr-id>11698068205613195480</prof:expr-id> <prof:expr-source>prof:report(xdmp:request())</prof:expr-source> <prof:uri/> <prof:line>3</prof:line> <prof:count>0</prof:count> <prof:shallow-time>PT0S</prof:shallow-time> <prof:deep-time>PT0S</prof:deep-time> </prof:expression> <prof:expression> <prof:expr-id>6277409173981051716</prof:expr-id> <prof:expr-source>xdmp:request()</prof:expr-source> <prof:uri/> <prof:line>3</prof:line> <prof:count>1</prof:count> <prof:shallow-time>PT0S</prof:shallow-time> <prof:deep-time>PT0S</prof:deep-time> </prof:expression> <prof:expression> <prof:expr-id>13716364291188563274</prof:expr-id> <prof:expr-source>current-dateTime()</prof:expr-source> <prof:uri/> <prof:line>2</prof:line> <prof:count>1</prof:count> <prof:shallow-time>PT0S</prof:shallow-time> <prof:deep-time>PT0S</prof:deep-time> </prof:expression> <prof:expression> <prof:expr-id>6174150852679522465</prof:expr-id> <prof:expr-source>prof:enable(xdmp:request())</prof:expr-source> <prof:uri/> <prof:line>1</prof:line> <prof:count>1</prof:count> <prof:shallow-time>PT0S</prof:shallow-time> <prof:deep-time>PT0S</prof:deep-time> </prof:expression> </prof:histogram> </prof:report>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.