Description
Not sure if this needs to behave like this for any particular reason but:
gremlin> g.V().both().profile() ==>Traversal Metrics Step Count Traversers Time (ms) % Dur ============================================================================================================= TinkerGraphStep(vertex,[]) 1 1 0.055 67.30 VertexStep(BOTH,vertex) 2 2 0.012 15.51 NoOpBarrierStep(2500) 2 1 0.014 17.19 >TOTAL - - 0.082 -
the NoOpBarrierStep doesn't get added unless profile() is present as shown in this explain():
gremlin> g.V().both().explain() ==>Traversal Explanation ======================================================================================== Original Traversal [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] ConnectiveStrategy [D] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] MatchPredicateStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] EarlyLimitStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] FilterRankingStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] InlineFilterStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] IncidentToAdjacentStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] AdjacentToIncidentStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] RepeatUnrollStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] CountStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] PathRetractionStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] LazyBarrierStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] TinkerGraphCountStrategy [P] [GraphStep(vertex,[]), VertexStep(BOTH,vertex)] TinkerGraphStepStrategy [P] [TinkerGraphStep(vertex,[]), VertexStep(BOTH,vertex)] ProfileStrategy [F] [TinkerGraphStep(vertex,[]), VertexStep(BOTH,vertex)] StandardVerificationStrategy [V] [TinkerGraphStep(vertex,[]), VertexStep(BOTH,vertex)] Final Traversal [TinkerGraphStep(vertex,[]), VertexStep(BOTH,vertex)]
unless of course we explain() the profile() which seems weird:
gremlin> g.V().both().profile().explain() ==>Traversal Explanation ========================================================================================================================================================================================================== Original Traversal [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] ConnectiveStrategy [D] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] MatchPredicateStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] EarlyLimitStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] FilterRankingStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] InlineFilterStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] IncidentToAdjacentStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] AdjacentToIncidentStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] RepeatUnrollStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] CountStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] PathRetractionStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), ProfileSideEffectStep, SideEffectCapStep([~metrics])] LazyBarrierStrategy [O] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), NoOpBarrierStep(2500), ProfileSideEffectStep, SideEffectCapStep([~metrics])] TinkerGraphCountStrategy [P] [GraphStep(vertex,[]), VertexStep(BOTH,vertex), NoOpBarrierStep(2500), ProfileSideEffectStep, SideEffectCapStep([~metrics])] TinkerGraphStepStrategy [P] [TinkerGraphStep(vertex,[]), VertexStep(BOTH,vertex), NoOpBarrierStep(2500), ProfileSideEffectStep, SideEffectCapStep([~metrics])] ProfileStrategy [F] [TinkerGraphStep(vertex,[]), ProfileStep, VertexStep(BOTH,vertex), ProfileStep, NoOpBarrierStep(2500), ProfileStep, ProfileSideEffectStep, SideEffectCapStep([~metrics] )] StandardVerificationStrategy [V] [TinkerGraphStep(vertex,[]), ProfileStep, VertexStep(BOTH,vertex), ProfileStep, NoOpBarrierStep(2500), ProfileStep, ProfileSideEffectStep, SideEffectCapStep([~metrics] )] Final Traversal [TinkerGraphStep(vertex,[]), ProfileStep, VertexStep(BOTH,vertex), ProfileStep, NoOpBarrierStep(2500), ProfileStep, ProfileSideEffectStep, SideEffectCapStep([~metrics] )]
Seems like this is a bit of a bug in the sense that I would expect explain() and profile() to examine the same working traversal up to the point of that call.