org.modeshape.jcr.api.monitor

## Interface History

-     public interface History

  An immutable history of a metric for a given window in time.
  Since:
    3.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static History` | `NO_HISTORY` A history with no statistics, no window, no start or end time, and no duration.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DateTime` | `getEndTime()` Get the timestamp (including time zone information) at which this history window ends.
    `DateTime` | `getStartTime()` Get the timestamp (including time zone information) at which this history window starts.
    `Statistics[]` | `getStats()` Get the statistics for that make up the history.
    `long` | `getTotalDuration(TimeUnit unit)` Get the total duration of this history window.
    `Window` | `getWindow()` Get the kind of window.

- - ### Field Detail

    - #### NO_HISTORY

          static final History NO_HISTORY

      A history with no statistics, no window, no start or end time, and no duration.

  - ### Method Detail

    - #### getWindow

          Window getWindow()

      Get the kind of window.
      Returns:
        the window type; never null

    - #### getTotalDuration

          long getTotalDuration(TimeUnit unit)

      Get the total duration of this history window.
      Parameters:
        `unit` - the desired time unit; if null, then `TimeUnit.SECONDS` is used
      Returns:
        the duration

    - #### getStartTime

          DateTime getStartTime()

      Get the timestamp (including time zone information) at which this history window starts.
      Returns:
        the time at which this window starts

    - #### getEndTime

          DateTime getEndTime()

      Get the timestamp (including time zone information) at which this history window ends.
      Returns:
        the time at which this window ends

    - #### getStats

          Statistics[] getStats()

      Get the statistics for that make up the history.
      Returns:
        the statistics; never null, but the array may contain null if the window is longer than the lifetime of the repository

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