org.apache.tinkerpop.gremlin.process.traversal.util

## 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

  Author:
    Bob Briody (http://bobbriody.com), Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics

      `ELEMENT_COUNT_ID, PERCENT_DURATION_KEY, TRAVERSER_COUNT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTraversalMetrics()`
    `DefaultTraversalMetrics(long totalStepDurationNs, List<MutableMetrics> metricsMap)` This is only a convenient constructor needed for GraphSON deserialization.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getDuration(TimeUnit unit)` Get the total duration taken by the Traversal.
    `Collection<ImmutableMetrics>` | `getMetrics()`
    `Metrics` | `getMetrics(int index)` Get an individual Metrics object by the index of the profiled Step.
    `Metrics` | `getMetrics(String id)` Get an individual Metrics object by the id of the profiled Step.
    `static DefaultTraversalMetrics` | `merge(Iterator<DefaultTraversalMetrics> toMerge)`
    `void` | `setMetrics(Traversal.Admin traversal, boolean onGraphComputer)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultTraversalMetrics

          public DefaultTraversalMetrics()

    - #### DefaultTraversalMetrics

          public DefaultTraversalMetrics(long totalStepDurationNs,
                                         List<MutableMetrics> metricsMap)

      This is only a convenient constructor needed for GraphSON deserialization.

  - ### Method Detail

    - #### 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()

      Specified by:
        `getMetrics` in interface `TraversalMetrics`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### merge

          public static DefaultTraversalMetrics merge(Iterator<DefaultTraversalMetrics> toMerge)

    - #### setMetrics

          public void setMetrics(Traversal.Admin traversal,
                                 boolean onGraphComputer)

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.