Class DefaultTraversalMetrics

java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalMetrics
All Implemented Interfaces:
Serializable, TraversalMetrics

public final class DefaultTraversalMetrics extends Object implements TraversalMetrics, Serializable
Default implementation for TraversalMetrics that aggregates ImmutableMetrics instances from a Traversal.
Author:
Bob Briody (http://bobbriody.com), Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
See Also:
  • Constructor Details

    • DefaultTraversalMetrics

      public DefaultTraversalMetrics()
    • DefaultTraversalMetrics

      public DefaultTraversalMetrics(long totalStepDurationNs, List<MutableMetrics> orderedMetrics)
      This is only a convenient constructor needed for GraphSON deserialization.
  • Method Details

    • getDuration

      public long getDuration(TimeUnit unit)
      Description copied from interface: TraversalMetrics
      Get the total duration taken by the Traversal.
      Specified by:
      getDuration in interface TraversalMetrics
      Returns:
      total duration taken by the Traversal.
    • getMetrics

      public Metrics getMetrics(int index)
      Description copied from interface: TraversalMetrics
      Get an individual Metrics object by the index of the profiled Step.
      Specified by:
      getMetrics in interface TraversalMetrics
      Returns:
      an individual Metrics object.
    • getMetrics

      public Metrics getMetrics(String id)
      Description copied from interface: TraversalMetrics
      Get an individual Metrics object by the id of the profiled Step.
      Specified by:
      getMetrics in interface TraversalMetrics
      Returns:
      an individual Metrics object.
    • getMetrics

      public Collection<ImmutableMetrics> getMetrics()
      Description copied from interface: TraversalMetrics
      Gets all the metrics.
      Specified by:
      getMetrics in interface TraversalMetrics
    • isFinalized

      public boolean isFinalized()
      The metrics have been computed and can no longer be modified.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setMetrics

      public void setMetrics(Traversal.Admin traversal, boolean onGraphComputer)
      Extracts metrics from the provided Traversal and computes metrics. Calling this method finalizes the metrics such that their values can no longer be modified.