com.h3c.sdn.metric

## Interface TimeStampedMetric

- All Known Implementing Classes:
    TimeStampedCounter, TimeStampedGauge, TimeStampedHistogram, TimeStampedMeter, TimeStampedRatioGauge, TimeStampedRollingCounter, TimeStampedTimer

      public interface TimeStampedMetric

  Methods for a Coda Hale `Metric` with associated time stamp management.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataPoint` | `extractDataPoint()` Extract a `DataPoint` from this object.
    `MetricDescriptor` | `getDescriptor()` Gets the `MetricDescriptor` that describes this `TimeStampedMetric` object.
    `long` | `getMsSpanned()` Determines the number of milliseconds spanned between the latest (update) time stamp and the oldest (previous) time stamp, accounting for roll-over of the time stamp.
    `long` | `getPreviousTimeStamp()` Gets the previous time stamp.
    `String` | `getUid()` Gets the UID.
    `long` | `getUpdateTimeStamp()` Gets the update time stamp.
    `void` | `reset()` Prepares this `TimeStampedMetric` for use in a new time period.
    `void` | `setPreviousTimeStamp(long time)` Sets the previous time stamp.
    `void` | `setUid(String uid)` Sets the UID of this object.
    `void` | `setUpdateTimeStamp(long time)` Sets the update time stamp.
    `void` | `updateTimeStamp()` Convenience method that sets the update time stamp to the current time.

- - ### Method Detail

    - #### extractDataPoint

          DataPoint extractDataPoint()

      Extract a `DataPoint` from this object.
      Returns:
        the current value of this `TimeStampedMetric` represented as a `DataPoint`

    - #### getDescriptor

          MetricDescriptor getDescriptor()

      Gets the `MetricDescriptor` that describes this `TimeStampedMetric` object.
      Returns:
        `MetricDescriptor` that describes this `TimeStampedMetric`

    - #### getPreviousTimeStamp

          long getPreviousTimeStamp()

      Gets the previous time stamp.
      Returns:
        previous time stamp

    - #### getMsSpanned

          long getMsSpanned()

      Determines the number of milliseconds spanned between the latest (update) time stamp and the oldest (previous) time stamp, accounting for roll-over of the time stamp.
      Returns:
        milliseconds spanned between the update and previous time stamps

    - #### getUid

          String getUid()

      Gets the UID.
      Returns:
        the UID

    - #### getUpdateTimeStamp

          long getUpdateTimeStamp()

      Gets the update time stamp.
      Returns:
        update time stamp

    - #### reset

          void reset()

      Prepares this `TimeStampedMetric` for use in a new time period.

    - #### setPreviousTimeStamp

          void setPreviousTimeStamp(long time)

      Sets the previous time stamp.
      Parameters:
        `time` - previous time stamp

    - #### setUid

          void setUid(String uid)

      Sets the UID of this object.
      Parameters:
        `uid` - new UID for this object

    - #### setUpdateTimeStamp

          void setUpdateTimeStamp(long time)

      Sets the update time stamp.
      Parameters:
        `time` - update time stamp

    - #### updateTimeStamp

          void updateTimeStamp()

      Convenience method that sets the update time stamp to the current time.

Copyright © 2014. All Rights Reserved.