org.modeshape.jcr

## Class RepositoryStatistics.DurationActivityImpl

- java.lang.Object
- - org.modeshape.jcr.RepositoryStatistics.DurationActivityImpl

- All Implemented Interfaces:
    Comparable<DurationActivity>, DurationActivity
  Enclosing class:
    RepositoryStatistics

      @Immutable
      public static final class RepositoryStatistics.DurationActivityImpl
      extends Object
      implements DurationActivity

  The `RepositoryStatistics.MetricHistory` specialization used for recording the statistics for activities with measured durations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `duration`
    `protected Map<String,String>` | `payload`
    `protected TimeUnit` | `timeUnit`

    - ### Fields inherited from interface org.modeshape.jcr.api.monitor.DurationActivity

      `NO_DURATION_RECORDS`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `RepositoryStatistics.DurationActivityImpl(long duration, TimeUnit timeUnit, Map<String,String> payload)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(DurationActivity that)`
    `long` | `getDuration(TimeUnit unit)` Get the duration of this activity.
    `Map<String,String>` | `getPayload()` Get the payload for this activity.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### duration

          protected final long duration

    - #### payload

          protected final Map<String,String> payload

    - #### timeUnit

          protected final TimeUnit timeUnit

  - ### Constructor Detail

    - #### RepositoryStatistics.DurationActivityImpl

          protected RepositoryStatistics.DurationActivityImpl(long duration,
                                                   TimeUnit timeUnit,
                                                   Map<String,String> payload)

  - ### Method Detail

    - #### getDuration

          public long getDuration(TimeUnit unit)

      Description copied from interface: `DurationActivity`
      Get the duration of this activity.
      Specified by:
        `getDuration` in interface `DurationActivity`
      Parameters:
        `unit` - the desired time unit for the duration
      Returns:
        the duration in the specified time unit

    - #### getPayload

          public Map<String,String> getPayload()

      Description copied from interface: `DurationActivity`
      Get the payload for this activity.
      Specified by:
        `getPayload` in interface `DurationActivity`
      Returns:
        the payload; may be null

    - #### compareTo

          public int compareTo(DurationActivity that)

      Specified by:
        `compareTo` in interface `Comparable<DurationActivity>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.