Interface Metrics
- 
- All Known Implementing Classes:
- ImmutableMetrics,- MutableMetrics
 
 public interface MetricsHolds metrics data; typically for .profile()-step analysis. Metrics may be nested. Nesting enables the ability to capture explicit metrics for multiple distinct operations. Annotations are used to store miscellaneous notes that might be useful to a developer when examining results, such as index coverage for Steps in a Traversal.- Author:
- Bob Briody (http://bobbriody.com)
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract 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 countKey)Get the count for the corresponding countKey.Map<String,Long>getCounts()Get the map of all counters.longgetDuration(TimeUnit units)Get the duration of execution time taken.StringgetId()Id of this Metrics.StringgetName()Name of this Metrics.Collection<? extends Metrics>getNested()Get the nested Metrics objects.MetricsgetNested(String metricsId)Get a nested Metrics object by Id.
 
- 
- 
- 
Method Detail- 
getDurationlong getDuration(TimeUnit units) Get the duration of execution time taken.
 - 
getCountLong getCount(String countKey) Get the count for the corresponding countKey. Returns null if countKey does not exist.- Parameters:
- countKey- key for counter to get.
 
 - 
getCountsMap<String,Long> getCounts() Get the map of all counters. This method copies the internal map.- Returns:
- a Map where the key is the counter ID and the value is the counter value.
 
 - 
getNameString getName() Name of this Metrics.- Returns:
- name of this Metrics.
 
 - 
getIdString getId() Id of this Metrics.- Returns:
- id of this Metrics.
 
 - 
getNestedCollection<? extends Metrics> getNested() Get the nested Metrics objects. Metrics will be ordered in the order they were inserted.- Returns:
- the nested Metrics objects.
 
 - 
getNestedMetrics getNested(String metricsId) Get a nested Metrics object by Id.- Returns:
- a nested Metrics object.
 
 - 
getAnnotationsMap<String,Object> getAnnotations() Obtain the annotations for this Metrics. Values may be of type String or Number.- Returns:
- the annotations for this Metrics. Modifications to the returned object are persisted in the original.
 
 
- 
 
-