Loading TOC...

MarkLogic Server 11.0 Product Documentation
prof:enable

prof:enable(
   $request-id as xs:unsignedLong
) as empty-sequence()

Summary

Enable profiling for this request. Profiling may be enabled or disabled as often as you like. Enabling while a request is enabled has no effect.

If profiling is not allowed for the App Server, this function does nothing.

Note that profiling does not cross eval/invoke boundaries. If the request being profiled calls xdmp:eval or xdmp:invoke, the individual expressions in that code will not be profiled. The overall time taken by the called code will appear as a single call in the caller's profiling report.

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.

Required Privileges

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).

Example

  prof:enable(xdmp:request())
  => ()
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.