public final class DefaultTraversalMetrics extends Object implements TraversalMetrics, Serializable
TraversalMetrics
that aggregates ImmutableMetrics
instances from a
Traversal
.ELEMENT_COUNT_ID, PERCENT_DURATION_KEY, TRAVERSER_COUNT_ID
Constructor and Description |
---|
DefaultTraversalMetrics() |
DefaultTraversalMetrics(long totalStepDurationNs,
List<MutableMetrics> orderedMetrics)
This is only a convenient constructor needed for GraphSON deserialization.
|
Modifier and Type | Method and Description |
---|---|
long |
getDuration(TimeUnit unit)
Get the total duration taken by the Traversal.
|
Collection<ImmutableMetrics> |
getMetrics()
Gets all the metrics.
|
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.
|
boolean |
isFinalized()
The metrics have been computed and can no longer be modified.
|
void |
setMetrics(Traversal.Admin traversal,
boolean onGraphComputer)
Extracts metrics from the provided
traversal and computes metrics. |
String |
toString() |
public DefaultTraversalMetrics()
public DefaultTraversalMetrics(long totalStepDurationNs, List<MutableMetrics> orderedMetrics)
public long getDuration(TimeUnit unit)
TraversalMetrics
getDuration
in interface TraversalMetrics
public Metrics getMetrics(int index)
TraversalMetrics
getMetrics
in interface TraversalMetrics
public Metrics getMetrics(String id)
TraversalMetrics
getMetrics
in interface TraversalMetrics
public Collection<ImmutableMetrics> getMetrics()
TraversalMetrics
getMetrics
in interface TraversalMetrics
public boolean isFinalized()
public void setMetrics(Traversal.Admin traversal, boolean onGraphComputer)
traversal
and computes metrics. Calling this method finalizes the
metrics such that their values can no longer be modified.Copyright © 2013–2018 Apache Software Foundation. All rights reserved.