org.apache.tinkerpop.gremlin.process.traversal.util

## Class MutableMetrics

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics
  - - org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics

- All Implemented Interfaces:
    Serializable, Cloneable, Metrics

      public class MutableMetrics
      extends ImmutableMetrics
      implements Cloneable

  Author:
    Bob Briody (http://bobbriody.com)
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics

      `annotations, counts, durationNs, id, name, nested`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MutableMetrics()`
    `` | `MutableMetrics(Metrics other)` Create a `MutableMetrics` from an immutable one.
    `` | `MutableMetrics(String id, String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addNested(MutableMetrics metrics)`
    `void` | `aggregate(MutableMetrics other)`
    `MutableMetrics` | `clone()`
    `protected void` | `copyMembers(ImmutableMetrics clone)`
    `void` | `finish(long bulk)`
    `ImmutableMetrics` | `getImmutableClone()`
    `MutableMetrics` | `getNested(String metricsId)` Get a nested Metrics object by Id.
    `void` | `incrementCount(String key, long incr)`
    `void` | `setAnnotation(String key, Object value)` Set an annotation value.
    `void` | `setCount(String key, long val)`
    `void` | `setDuration(long dur, TimeUnit unit)`
    `void` | `start()`
    `void` | `stop()`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics

      `getAnnotation, getAnnotations, getCount, getCounts, getDuration, getId, getName, getNested, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MutableMetrics

          protected MutableMetrics()

    - #### MutableMetrics

          public MutableMetrics(String id,
                                String name)

    - #### MutableMetrics

          public MutableMetrics(Metrics other)

      Create a `MutableMetrics` from an immutable one.

  - ### Method Detail

    - #### addNested

          public void addNested(MutableMetrics metrics)

    - #### start

          public void start()

    - #### stop

          public void stop()

    - #### incrementCount

          public void incrementCount(String key,
                                     long incr)

    - #### setDuration

          public void setDuration(long dur,
                                  TimeUnit unit)

    - #### setCount

          public void setCount(String key,
                               long val)

    - #### aggregate

          public void aggregate(MutableMetrics other)

    - #### setAnnotation

          public void setAnnotation(String key,
                                    Object value)

      Set an annotation value. Support exists for Strings and Numbers only. During a merge, Strings are concatenated into a "," (comma) separated list of distinct values (duplicates are ignored), and Numbers are summed.
      Parameters:
        `key` -
        `value` -

    - #### getNested

          public MutableMetrics getNested(String metricsId)

      Description copied from interface: `Metrics`
      Get a nested Metrics object by Id.
      Specified by:
        `getNested` in interface `Metrics`
      Overrides:
        `getNested` in class `ImmutableMetrics`
      Returns:
        a nested Metrics object.

    - #### getImmutableClone

          public ImmutableMetrics getImmutableClone()

    - #### copyMembers

          protected void copyMembers(ImmutableMetrics clone)

    - #### clone

          public MutableMetrics clone()

      Overrides:
        `clone` in class `Object`

    - #### finish

          public void finish(long bulk)

Copyright © 2013–2018 Apache Software Foundation. All rights reserved.