通过 rest api 启用配置文件不会在通过 Rest Api 获取活动请求时提供 phaseTimes
Enabling profile via rest api is not giving phaseTimes while fetching Active Requests via Rest Api
我在我的 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 查询执行相同的操作 workbench 我可以看到 phaseTimes 部分。
请帮忙
如果配置文件已设置(未关闭),PhaseTimes 将包含在 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"}'
我在我的 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 查询执行相同的操作 workbench 我可以看到 phaseTimes 部分。 请帮忙
如果配置文件已设置(未关闭),PhaseTimes 将包含在 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"}'