MarkLogic中是否公开了API,以便在规定的时间段内获取特定应用服务器中所有长时间运行的查询的列表,例如,如果我想要在过去12小时内花费超过5秒的所有查询,我可以使用API或调用来实现这一目标吗?
我正在使用调度作业调用的模块中的以下XQuery来生成当前结果,但它不足以满足我的所有要求
xquery version "1.0-ml";
import module namespace res="http://marklogic.com/manage/resource" at "/MarkLogic/manage/endpoints/resource.xqy";
import module namespace dmod = "http://marklogic.com/manage/database" at "/MarkLogic/manage/models/database-model.xqy";
import module namespace gmod="http://marklogic.com/manage/group" at "/MarkLogic/manage/models/group-model.xqy";
import module namespace hmod="http://marklogic.com/manage/host" at "/MarkLogic/manage/models/host-model.xqy";
import module namespace rmod = "http://marklogic.com/manage/request" at "/MarkLogic/manage/models/request-model.xqy";
import module namespace smod="http://marklogic.com/manage/server" at "/MarkLogic/manage/models/server-model.xqy";
declare namespace r ="http://marklogic.com/manage/requests";
let $results := rmod:get-list-default-view($res:context,gmod:get-id($res:context),hmod:get-id($res:context),smod:get-id($res:context),rmod:get-seconds-min($res:context))
return $results
答案 0 :(得分:0)
我建议您查看Troubleshooting queries并查看它是否有帮助,但它仅适用于当前查询。
计量历史记录会为您提供整体信息,但对于每个查询统计信息,您可能需要以某种方式记录该信息,然后将其提取出来。