com.h3c.util

## Class ReadOnlyThroughputTracker

- java.lang.Object
- - com.h3c.util.ThroughputTracker
  - - com.h3c.util.ReadOnlyThroughputTracker

-     public class ReadOnlyThroughputTracker
      extends ThroughputTracker

  Auxiliary to create a read-only view of a throughput tracker.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReadOnlyThroughputTracker(ThroughputTracker tt)` Create a read-only throughput tracker backed by the another throughput tracker.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(long count)` Disabled add operation.
    `double` | `duration()` Number of seconds elapsed since the tracker was last reset.
    `void` | `freeze()` Disabled freeze operation.
    `void` | `reset()` Disabled reset operation.
    `double` | `throughput()` Get the number of entities transferred per second.
    `long` | `total()` Get the number of entities accumulated by the tracker.

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

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

- - ### Constructor Detail

    - #### ReadOnlyThroughputTracker

          public ReadOnlyThroughputTracker(ThroughputTracker tt)

      Create a read-only throughput tracker backed by the another throughput tracker.
      Parameters:
        `tt` - backing tracker to be made read-only

  - ### Method Detail

    - #### reset

          public void reset()

      Disabled reset operation.
      Overrides:
        `reset` in class `ThroughputTracker`
      Throws:
        `UnsupportedOperationException` - if attempted on read-only tracker

    - #### freeze

          public void freeze()

      Disabled freeze operation.
      Overrides:
        `freeze` in class `ThroughputTracker`
      Throws:
        `UnsupportedOperationException` - if attempted on read-only tracker

    - #### add

          public void add(long count)

      Disabled add operation.
      Overrides:
        `add` in class `ThroughputTracker`
      Parameters:
        `count` - number of entities to consider as transfered
      Throws:
        `UnsupportedOperationException` - if attempted on read-only tracker

    - #### throughput

          public double throughput()

      Description copied from class: `ThroughputTracker`
      Get the number of entities transferred per second.
      Overrides:
        `throughput` in class `ThroughputTracker`
      Returns:
        entities per second throughput

    - #### total

          public long total()

      Description copied from class: `ThroughputTracker`
      Get the number of entities accumulated by the tracker.
      Overrides:
        `total` in class `ThroughputTracker`
      Returns:
        number of entities previously added to the tracker via add method

    - #### duration

          public double duration()

      Description copied from class: `ThroughputTracker`
      Number of seconds elapsed since the tracker was last reset.
      Overrides:
        `duration` in class `ThroughputTracker`
      Returns:
        fractional number of seconds since the last reset

Copyright © 2014. All Rights Reserved.