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 forTraversalMetricsthat aggregatesImmutableMetricsinstances from aTraversal.- Author:
- Bob Briody (http://bobbriody.com), Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetricsELEMENT_COUNT_ID, PERCENT_DURATION_KEY, TRAVERSER_COUNT_ID
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultTraversalMetrics()DefaultTraversalMetrics(long totalStepDurationNs, List<MutableMetrics> orderedMetrics)This is only a convenient constructor needed for GraphSON deserialization.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDuration(TimeUnit unit)Get the total duration taken by the Traversal.Collection<ImmutableMetrics>getMetrics()Gets all the metrics.MetricsgetMetrics(int index)Get an individual Metrics object by the index of the profiled Step.MetricsgetMetrics(String id)Get an individual Metrics object by the id of the profiled Step.booleanisFinalized()The metrics have been computed and can no longer be modified.voidsetMetrics(Traversal.Admin traversal, boolean onGraphComputer)Extracts metrics from the providedTraversaland computes metrics.StringtoString()
 
- 
- 
- 
Constructor Detail- 
DefaultTraversalMetricspublic DefaultTraversalMetrics() 
 - 
DefaultTraversalMetricspublic DefaultTraversalMetrics(long totalStepDurationNs, List<MutableMetrics> orderedMetrics)This is only a convenient constructor needed for GraphSON deserialization.
 
- 
 - 
Method Detail- 
getDurationpublic long getDuration(TimeUnit unit) Description copied from interface:TraversalMetricsGet the total duration taken by the Traversal.- Specified by:
- getDurationin interface- TraversalMetrics
- Returns:
- total duration taken by the Traversal.
 
 - 
getMetricspublic Metrics getMetrics(int index) Description copied from interface:TraversalMetricsGet an individual Metrics object by the index of the profiled Step.- Specified by:
- getMetricsin interface- TraversalMetrics
- Returns:
- an individual Metrics object.
 
 - 
getMetricspublic Metrics getMetrics(String id) Description copied from interface:TraversalMetricsGet an individual Metrics object by the id of the profiled Step.- Specified by:
- getMetricsin interface- TraversalMetrics
- Returns:
- an individual Metrics object.
 
 - 
getMetricspublic Collection<ImmutableMetrics> getMetrics() Description copied from interface:TraversalMetricsGets all the metrics.- Specified by:
- getMetricsin interface- TraversalMetrics
 
 - 
isFinalizedpublic boolean isFinalized() The metrics have been computed and can no longer be modified.
 - 
setMetricspublic void setMetrics(Traversal.Admin traversal, boolean onGraphComputer) Extracts metrics from the providedTraversaland computes metrics. Calling this method finalizes the metrics such that their values can no longer be modified.
 
- 
 
-