如何在 ArangoDB 的休息界面中获得经过的时间?
How do I get elapsed time in the rest interface with ArangoDB?
如何在 ArangoDB 的 REST 接口中获取经过的查询时间? (一个附加的 json 字段,其中包含经过的时间)
谢谢。
可以通过 setting the profile
option to true 获取 AQL 查询不同执行阶段的配置文件信息。
可以这样在 arangosh 中完成:
q = "FOR doc IN _users RETURN doc";
s = db._createStatement({ query: q, options: { profile: true } });
res = s.execute().getExtra();
getExtra()
的结果 json 将如下所示:
{
"stats" : {
"writesExecuted" : 0,
"writesIgnored" : 0,
"scannedFull" : 1,
"scannedIndex" : 0,
"filtered" : 0
},
"profile" : {
"initializing" : 0.0000040531158447265625,
"parsing" : 0.00003600120544433594,
"optimizing ast" : 0.0000040531158447265625,
"instantiating plan" : 0.000010967254638671875,
"optimizing plan" : 0.000023126602172851562,
"executing" : 0.00004601478576660156
},
"warnings" : [ ]
}
当然 https://docs.arangodb.com/Aql/Invoke.html 应该而且会提到这一点。
如何在 ArangoDB 的 REST 接口中获取经过的查询时间? (一个附加的 json 字段,其中包含经过的时间)
谢谢。
可以通过 setting the profile
option to true 获取 AQL 查询不同执行阶段的配置文件信息。
可以这样在 arangosh 中完成:
q = "FOR doc IN _users RETURN doc";
s = db._createStatement({ query: q, options: { profile: true } });
res = s.execute().getExtra();
getExtra()
的结果 json 将如下所示:
{
"stats" : {
"writesExecuted" : 0,
"writesIgnored" : 0,
"scannedFull" : 1,
"scannedIndex" : 0,
"filtered" : 0
},
"profile" : {
"initializing" : 0.0000040531158447265625,
"parsing" : 0.00003600120544433594,
"optimizing ast" : 0.0000040531158447265625,
"instantiating plan" : 0.000010967254638671875,
"optimizing plan" : 0.000023126602172851562,
"executing" : 0.00004601478576660156
},
"warnings" : [ ]
}
当然 https://docs.arangodb.com/Aql/Invoke.html 应该而且会提到这一点。