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
A Metrics implementation that cannot be modified.
Author:
Bob Briody (http://bobbriody.com), Stephen Mallette (http://stephen.genoprime.com)
See Also:
  • Field Details

  • Constructor Details

    • ImmutableMetrics

      protected ImmutableMetrics()
  • Method Details

    • getDuration

      public long getDuration(TimeUnit unit)
      Description copied from interface: Metrics
      Get the duration of execution time taken.
      Specified by:
      getDuration in interface Metrics
    • 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.
      Specified by:
      getCount in interface Metrics
      Parameters:
      key - key for counter to get.
    • getCounts

      public Map<String,Long> getCounts()
      Description copied from interface: Metrics
      Get the map of all counters. This method copies the internal map.
      Specified by:
      getCounts in interface Metrics
      Returns:
      a Map where the key is the counter ID and the value is the counter value.
    • getName

      public String getName()
      Description copied from interface: Metrics
      Name of this Metrics.
      Specified by:
      getName in interface Metrics
      Returns:
      name of this Metrics.
    • getId

      public String getId()
      Description copied from interface: Metrics
      Id of this Metrics.
      Specified by:
      getId in interface Metrics
      Returns:
      id of this Metrics.
    • 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.
      Specified by:
      getNested in interface Metrics
      Returns:
      the nested Metrics objects.
    • getNested

      public ImmutableMetrics getNested(String metricsId)
      Description copied from interface: Metrics
      Get a nested Metrics object by Id.
      Specified by:
      getNested in interface Metrics
      Returns:
      a nested Metrics object.
    • 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 interface Metrics
      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 interface Metrics
      Parameters:
      key - key of the annotation to obtain.
    • toString

      public String toString()
      Overrides:
      toString in class Object