我正在尝试测量Gremlin控制台中查询所花费的时间。每个gremlin提示是否都可以显示时间?类似于“ SET TIME ON”与Oracle的SQL控制台一起使用的方式。
答案 0 :(得分:1)
没有任何内容可以显示每次提示执行的时间。当然,您可以通过profile()
和explain()
步骤来遍历遍历并获取有关其内部执行方式的信息:
gremlin> g.V().out().profile()
==>Traversal Metrics
Step Count Traversers Time (ms) % Dur
=============================================================================================================
TinkerGraphStep(vertex,[]) 6 6 12.308 88.82
VertexStep(OUT,vertex) 6 6 1.268 9.15
NoOpBarrierStep(2500) 6 4 0.281 2.03
>TOTAL - - 13.857 -
gremlin> g.V().out().explain()
==>Traversal Explanation
=======================================================================================
Original Traversal [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
ConnectiveStrategy [D] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
IncidentToAdjacentStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
MatchPredicateStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
FilterRankingStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
InlineFilterStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
AdjacentToIncidentStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
RepeatUnrollStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
CountStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
PathRetractionStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
LazyBarrierStrategy [O] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
TinkerGraphCountStrategy [P] [GraphStep(vertex,[]), VertexStep(OUT,vertex)]
TinkerGraphStepStrategy [P] [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex)]
ProfileStrategy [F] [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex)]
StandardVerificationStrategy [V] [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex)]
Final Traversal [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex)]