The queue size is per host. You will need to take your current host (or
specific host in a clustered environment) and get the ID of the host. That
value gets used to query the server-status. One of the values that gets
returned contains the queue size and you can count the request-statuses to get
a number of tasks currently being processed.
Sample:
let $id :=
fn:data(xdmp:host-status(xdmp:host())//*:task-server/*:task-server-id)
let $queue-size := xdmp:server-status(xdmp:host(),$id)//*:queue-size
let $current-size :=
fn:count(xdmp:server-status(xdmp:host(),$id)//*:request-statuses/*)
Brad Rix
Senior Developer
+1 (303) 542-2172 | Office
+1 (303) 915-2771 | Mobile
[email protected]
http://www.flatironssolutions.com
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jakob Fix
Sent: Tuesday, July 07, 2009 11:26 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] admin api for current number of tasks in queue
(task server)?
Hi MarkLogic users,
is there an api call to find out the *current* length of the queue
etc.? I cannot find it in the 4.0.3 documentation.
While I noticed the admin:taskserver-get-queue-size this seems to
return the *max* queue size.
However, I would like to know the number of tasks still in the queue.
The background to this question is the implementation of a progress
bar based on the number of tasks still in the queue compared to the
total number of tasks. Maybe there is another way to implement this?
cheers,
Jakob.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general