You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/03/03 18:03:28 UTC

[05/12] incubator-tinkerpop git commit: Update traversal docs for Profile step changes.

Update traversal docs for Profile step changes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/86941ee5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/86941ee5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/86941ee5

Branch: refs/heads/TINKERPOP-1192
Commit: 86941ee5c6ff37f2bc4f88ea520a530e9372ba79
Parents: 7374ee4
Author: rjbriody <bo...@datastax.com>
Authored: Tue Mar 1 08:35:45 2016 -0500
Committer: rjbriody <bo...@datastax.com>
Committed: Tue Mar 1 08:35:45 2016 -0500

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/86941ee5/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 410018e..d5d151d 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -1346,7 +1346,7 @@ profile results, but durations are not exact. Thus, durations are best considere
 
 [gremlin-groovy,modern]
 ----
-g.V().out('created').repeat(both()).times(3).hasLabel('person').values('age').sum().profile().cap(TraversalMetrics.METRICS_KEY)
+g.V().out('created').repeat(both()).times(3).hasLabel('person').values('age').sum().profile()
 ----
 
 The `profile()`-step generates a `TraversalMetrics` sideEffect object that contains the following information:
@@ -1363,6 +1363,15 @@ into a single traverser. That new traverser has a `Traverser.bulk()` that is the
 bulks. On the other hand, the `Count` represents the sum of all `Traverser.bulk()` results and thus, expresses the
 number of "represented" (not enumerated) traversers. `Traversers` will always be less than or equal to `Count`.
 
+A side effect key can also be passed to the `profile()`-step for situations when it is important to iterate the normal
+results of the Traversal and retrieve the `TraversalMetrics` afterwards, as shown here:
+
+---
+t = g.V().out('created').repeat(both()).times(3).hasLabel('person').values('age').sum().profile('metrics')
+t.iterate()
+metrics = t.asAdmin().getSideEffects().get('metrics')
+---
+
 For traversal compilation information, please see <<explain-step,`explain()`>>-step.
 
 [[range-step]]