Class MutableMetrics
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics
- 
- org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics
 
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Metrics
 
 public class MutableMetrics extends ImmutableMetrics implements Cloneable AMetricsimplementation that can be modified.- Author:
- Bob Briody (http://bobbriody.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetricsannotations, counts, durationNs, id, name, nested
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedMutableMetrics()MutableMetrics(String id, String name)MutableMetrics(Metrics other)Create aMutableMetricsfrom an immutable one.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNested(MutableMetrics metrics)voidaggregate(MutableMetrics other)Aggregate one set of metrics into the current body of metrics.MutableMetricsclone()protected voidcopyMembers(ImmutableMetrics clone)voidfinish(long bulk)ImmutableMetricsgetImmutableClone()Gets a copy of the metrics that is immutable.MutableMetricsgetNested(String metricsId)Get a nested Metrics object by Id.voidincrementCount(String key, long incr)Increments a count metric.booleanisFinalized()Once these metrics are used in computing the final metrics to report throughTraversalMetricsthey should no longer be modified and are thus finalized.voidsetAnnotation(String key, Object value)Set an annotation value.voidsetCount(String key, long val)Directly set the count for the metric.voidsetDuration(long dur, TimeUnit unit)Directly set the duration for the metric.voidstart()Starts the timer for this metric.voidstop()Stops the timer for this metric and increments the overall duration.- 
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetricsgetAnnotation, getAnnotations, getCount, getCounts, getDuration, getId, getName, getNested, toString
 
- 
 
- 
- 
- 
Method Detail- 
addNestedpublic void addNested(MutableMetrics metrics) 
 - 
startpublic void start() Starts the timer for this metric. Should not be called again without first callingstop().
 - 
stoppublic void stop() Stops the timer for this metric and increments the overall duration. Should not be called without first callingstart().
 - 
incrementCountpublic void incrementCount(String key, long incr) Increments a count metric.
 - 
setDurationpublic void setDuration(long dur, TimeUnit unit)Directly set the duration for the metric.
 - 
setCountpublic void setCount(String key, long val) Directly set the count for the metric.
 - 
aggregatepublic void aggregate(MutableMetrics other) Aggregate one set of metrics into the current body of metrics.
 - 
setAnnotationpublic void setAnnotation(String key, Object value) Set an annotation value. Support exists for Strings and Numbers only. During a merge, Strings are concatenated into a "," (comma) separated list of distinct values (duplicates are ignored), and Numbers are summed.
 - 
getNestedpublic MutableMetrics getNested(String metricsId) Description copied from interface:MetricsGet a nested Metrics object by Id.- Specified by:
- getNestedin interface- Metrics
- Overrides:
- getNestedin class- ImmutableMetrics
- Returns:
- a nested Metrics object.
 
 - 
isFinalizedpublic boolean isFinalized() Once these metrics are used in computing the final metrics to report throughTraversalMetricsthey should no longer be modified and are thus finalized.
 - 
getImmutableClonepublic ImmutableMetrics getImmutableClone() Gets a copy of the metrics that is immutable. Once this clone is made, theMutableMetricscan no longer be modified themselves. This prevents custom steps that implementProfilingfrom adding to the metrics after the traversal is complete.
 - 
copyMembersprotected void copyMembers(ImmutableMetrics clone) 
 - 
clonepublic MutableMetrics clone() 
 - 
finishpublic void finish(long bulk) 
 
- 
 
-