如何解决通过rest api启用配置文件不会在通过Rest api获取活动请求时提供phaseTimes
我在CB服务器中启用了配置文件,配置文件设置为阶段。
执行此curl命令:-
curl --location --request POST 'http://localhost:8093/admin/settings' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==' \ --data-raw '{ "profile": "phases" }'
因此配置文件已从off
更新为phases
,如下所示:-
{
"auto-prepare": false,"completed": {
"aborted": null,"threshold": 1000
},"completed-limit": 4000,"completed-threshold": 1000,"controls": false,"cpuprofile": "","debug": false,"functions-limit": 16384,"keep-alive-length": 16384,"loglevel": "INFO","max-index-api": 4,"max-parallelism": 1,"memprofile": "","mutexprofile": false,"n1ql-feat-ctrl": 12,"pipeline-batch": 16,"pipeline-cap": 512,"prepared-limit": 16384,"pretty": false,"profile": "phases","request-size-cap": 67108864,"scan-cap": 512,"servicers": 24,"timeout": 0
}
但是在查询活动请求时,即http://localhost:8093/admin/active_requests
我收到以下提到的输出:-
[
{
"clientContextID": "1a1d8828-b06a-46f3-a5fe-13a9841cee18","elapsedTime": "1.4613172s","executionTime": "1.4610895s","phaseCounts": {
"fetch": 2304,"primaryScan": 2727
},"phaseOperators": {
"authorize": 1,"fetch": 1,"primaryScan": 1
},"requestId": "6f44adea-9752-491d-936d-b36c7d450029","requestTime": "2020-08-27T21:11:28.344Z","scanConsistency": "unbounded","state": "running","statement": "SELECT * FROM `beer-sample`","users": "Administrator"
}
]
在我的情况下,为什么不出现phaseTimes部分。
但是,如果通过Couchbase查询工作台执行相同操作,则可以看到phaseTimes部分。 请帮忙。
解决方法
如果配置文件已设置(未关闭),则PhaseTime将包含在active_requests,completed_requests中。从默认6.50起,这些文件甚至在配置文件关闭时都包含在内。
curl -u user:pass http://localhost:8093/admin/active_requests
This list all active requests. But will not give PhaseTimes. only single active request gives PhaseTimes via admin endpoint
Example: curl -u user:pass -XPOST http://localhost:8093/admin/active_requests/<request-uuid>
Alternative for all active_requests is use query endpoint with select query as follows.
curl -u user:pass -v http://localhost:8093/query/service -H "Content-Type: application/json" -d '{"statement":"SELECT a.* FROM system:active_requests AS a"}'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。