Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active March 6, 2024 21:58
Show Gist options
  • Save spmallette/e0e0e7deb64044bdd33daa7bdc57d3fa to your computer and use it in GitHub Desktop.
Save spmallette/e0e0e7deb64044bdd33daa7bdc57d3fa to your computer and use it in GitHub Desktop.
gremlin> g.V().hasLabel('person').order().by('name').store('x').by('age').project('name','running').by('name').by(select('x').mean(local))
==>[name:josh,running:32.0]
==>[name:marko,running:30.5]
==>[name:peter,running:32.0]
==>[name:vadas,running:30.75]
gremlin> g.V().hasLabel('person').aggregate('results').profile('profile').cap('results','profile').next()
==>profile=Traversal Metrics
Step Count Traversers Time (ms) % Dur
=============================================================================================================
TinkerGraphStep(vertex,[~label.eq(person)]) 4 4 0.087 62.78
AggregateGlobalStep(results,null) 4 4 0.051 37.22
>TOTAL - - 0.139 -
==>results={v[1]=1, v[2]=1, v[4]=1, v[6]=1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment