Bob, The built-in status APIs can do this.
http://developer.marklogic.com/pubs/4.1/apidocs/ServerMonitoring.html#xdmp:host-status http://developer.marklogic.com/pubs/4.1/apidocs/ServerMonitoring.html#xdmp:server-status Here's a quick sample: declare namespace hs="http://marklogic.com/xdmp/status/host" ; declare namespace ss="http://marklogic.com/xdmp/status/server" ; let $hid := xdmp:host() let $tid := xdmp:host-status($hid)/hs:task-server/hs:task-server-id return xdmp:server-status($hid, $tid)/(ss:queue-size|ss:queue-limit) => <queue-size xmlns="http://marklogic.com/xdmp/status/server">0</queue-size> <queue-limit xmlns="http://marklogic.com/xdmp/status/server">100000</queue-limit> You might also consider increasing the number of task server threads, and increasing the queue size to 1M. -- Mike On 2010-06-03 08:38, Bob Runstein wrote: > > Is there a function to return the number of tasks queued up in the Task > Server (or let me know when it is empty)? We have some pipeline processing > that queues up a large number of tasks and have tried to throttle the ingest > by submitting a batch of documents at preset time intervals, but we have > still overflowed the queue (currently at 500,000). While we could make the > time intervals longer or increase the queue size even more, it would be > preferable if we could check for an empty queue before we submit the next > batch. > > Bob > > _______________________________________________ > General mailing list > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general