XQuery - a log captured by a REST call or method call

We are in the process of fine-tuning our application, and I am in the process of figuring out the time delay between the method call. This method can be a function call or a rest process.

let $x := fn:current-time()
let $re := xdmp:http-post('http://www.somerestdomain.com',())
let $y := fn:currrent-time()
return $x - $y

or

let $x := fn:current-time()
let $re := domain:call-some-long-running-function()
let $y := fn:currrent-time()
return $x - $y

Profiling shows that the XQuery engine optimizes the call fn:current-time()and always assigns $ x and $ y as the same value.

I found this sample code which also has some wrt problems for MarkLogic http://en.wikibooks.org/wiki/XQuery/Uptime_monitor

We use the MarkLogic Xml database and the Pseudocode mentioned above applies to the MarkLogic API

Is there any way to find out XQuery TimeOut?

+3
source share
2

xdmp:elapsed-time() current-time(), , 4.2, .

, current-time() , xdmp:eval(), .

. - CQ (http://developer.marklogic.com/code/cq) Profile . , (http://developer.marklogic.com/pubs/5.0/apidocs/ProfileBuiltins.html). html- . MarkLogic Server.

+3

MarkLogic multiversion concurrency, , 1 . $x $y , .

.

(xdmp:http-get("http://www.marklogic.com"), xdmp:query-meters())

. .

(xdmp:http-post('http://www.somerestdomain.com',()), xdmp:query-meters())
+2

All Articles