Interface Metrics
- All Known Implementing Classes:
ImmutableMetrics,MutableMetrics
public interface Metrics
Holds 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 Summary
Modifier and TypeMethodDescriptiongetAnnotation(String key) Obtain the annotation with the specified key.Obtain the annotations for this Metrics.Get the count for the corresponding countKey.Get the map of all counters.longgetDuration(TimeUnit units) Get the duration of execution time taken.getId()Id of this Metrics.getName()Name of this Metrics.Collection<? extends Metrics>Get the nested Metrics objects.Get a nested Metrics object by Id.
-
Method Details
-
getDuration
Get the duration of execution time taken. -
getCount
Get the count for the corresponding countKey. Returns null if countKey does not exist.- Parameters:
countKey- key for counter to get.
-
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.
-
getName
String getName()Name of this Metrics.- Returns:
- name of this Metrics.
-
getId
String getId()Id of this Metrics.- Returns:
- id of this Metrics.
-
getNested
Collection<? extends Metrics> getNested()Get the nested Metrics objects. Metrics will be ordered in the order they were inserted.- Returns:
- the nested Metrics objects.
-
getNested
Get a nested Metrics object by Id.- Returns:
- a nested Metrics 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.
-
getAnnotation
Obtain the annotation with the specified key. Values may be of type String or Number.- Parameters:
key- key of the annotation to obtain.
-