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
AMetrics
implementation 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>
annotations
protected Map<String,AtomicLong>
counts
protected long
durationNs
protected String
id
protected String
name
protected Map<String,ImmutableMetrics>
nested
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImmutableMetrics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAnnotation(String key)
Obtain the annotation with the specified key.Map<String,Object>
getAnnotations()
Obtain the annotations for this Metrics.Long
getCount(String key)
Get the count for the corresponding countKey.Map<String,Long>
getCounts()
Get the map of all counters.long
getDuration(TimeUnit unit)
Get the duration of execution time taken.String
getId()
Id of this Metrics.String
getName()
Name of this Metrics.Collection<ImmutableMetrics>
getNested()
Get the nested Metrics objects.ImmutableMetrics
getNested(String metricsId)
Get a nested Metrics object by Id.String
toString()
-
-
-
Method Detail
-
getDuration
public long getDuration(TimeUnit unit)
Description copied from interface:Metrics
Get the duration of execution time taken.- Specified by:
getDuration
in interfaceMetrics
-
getCount
public Long getCount(String key)
Description copied from interface:Metrics
Get the count for the corresponding countKey. Returns null if countKey does not exist.
-
getCounts
public Map<String,Long> getCounts()
Description copied from interface:Metrics
Get the map of all counters. This method copies the internal map.
-
getNested
public Collection<ImmutableMetrics> getNested()
Description copied from interface:Metrics
Get the nested Metrics objects. Metrics will be ordered in the order they were inserted.
-
getNested
public ImmutableMetrics getNested(String metricsId)
Description copied from interface:Metrics
Get a nested Metrics object by Id.
-
getAnnotations
public Map<String,Object> getAnnotations()
Description copied from interface:Metrics
Obtain the annotations for this Metrics. Values may be of type String or Number.- Specified by:
getAnnotations
in 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:Metrics
Obtain the annotation with the specified key. Values may be of type String or Number.- Specified by:
getAnnotation
in interfaceMetrics
- Parameters:
key
- key of the annotation to obtain.
-
-