Class ImmutableMetrics
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics
-
- All Implemented Interfaces:
Serializable,Metrics
- Direct Known Subclasses:
MutableMetrics
public class ImmutableMetrics extends Object implements Metrics, Serializable
AMetricsimplementation that cannot be modified.- Author:
- Bob Briody (http://bobbriody.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>annotationsprotected Map<String,AtomicLong>countsprotected longdurationNsprotected Stringidprotected Stringnameprotected Map<String,ImmutableMetrics>nested
-
Constructor Summary
Constructors Modifier Constructor Description protectedImmutableMetrics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAnnotation(String key)Obtain the annotation with the specified key.Map<String,Object>getAnnotations()Obtain the annotations for this Metrics.LonggetCount(String key)Get the count for the corresponding countKey.Map<String,Long>getCounts()Get the map of all counters.longgetDuration(TimeUnit unit)Get the duration of execution time taken.StringgetId()Id of this Metrics.StringgetName()Name of this Metrics.Collection<ImmutableMetrics>getNested()Get the nested Metrics objects.ImmutableMetricsgetNested(String metricsId)Get a nested Metrics object by Id.StringtoString()
-
-
-
Method Detail
-
getDuration
public long getDuration(TimeUnit unit)
Description copied from interface:MetricsGet the duration of execution time taken.- Specified by:
getDurationin interfaceMetrics
-
getCount
public Long getCount(String key)
Description copied from interface:MetricsGet the count for the corresponding countKey. Returns null if countKey does not exist.
-
getCounts
public Map<String,Long> getCounts()
Description copied from interface:MetricsGet the map of all counters. This method copies the internal map.
-
getNested
public Collection<ImmutableMetrics> getNested()
Description copied from interface:MetricsGet the nested Metrics objects. Metrics will be ordered in the order they were inserted.
-
getNested
public ImmutableMetrics getNested(String metricsId)
Description copied from interface:MetricsGet a nested Metrics object by Id.
-
getAnnotations
public Map<String,Object> getAnnotations()
Description copied from interface:MetricsObtain the annotations for this Metrics. Values may be of type String or Number.- Specified by:
getAnnotationsin interfaceMetrics- Returns:
- the annotations for this Metrics. Modifications to the returned object are persisted in the original.
-
getAnnotation
public Object getAnnotation(String key)
Description copied from interface:MetricsObtain the annotation with the specified key. Values may be of type String or Number.- Specified by:
getAnnotationin interfaceMetrics- Parameters:
key- key of the annotation to obtain.
-
-