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 Details

    • getDuration

      long getDuration(TimeUnit units)
      Get the duration of execution time taken.
    • getCount

      Long getCount(String countKey)
      Get the count for the corresponding countKey. Returns null if countKey does not exist.
      Parameters:
      countKey - key for counter to get.
    • getCounts

      Map<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.
    • 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

      Metrics getNested(String metricsId)
      Get a nested Metrics object by Id.
      Returns:
      a nested Metrics object.
    • getAnnotations

      Map<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.
    • getAnnotation

      Object getAnnotation(String key)
      Obtain the annotation with the specified key. Values may be of type String or Number.
      Parameters:
      key - key of the annotation to obtain.