com.h3c.util.perf.model

## Class MetricsCache

- java.lang.Object
- - com.h3c.util.perf.model.MetricsCache

- All Implemented Interfaces:
    PerfMetricsProvider

      public class MetricsCache
      extends Object
      implements PerfMetricsProvider

  An in-memory cache of performance metrics.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Perf` | `addPerfIfAbsent(String perfName)` Add a new performance monitor if one has not existed, else return the existing one.
    `void` | `clearMetrics(String perfName)` Clear all metrics for the given `Perf`'s name.
    `void` | `clearPerfs()` Clear all performance measurements.
    `Collection<Perf>` | `getAllPerfs()` Get all `Perf`'s.
    `Perf` | `getPerf(String perfName)` Retrieve the `Perf` instance for the given name.
    `static PerfMetricsProvider` | `instance()` Return a singleton instance.

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

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

- - ### Method Detail

    - #### instance

          public static PerfMetricsProvider instance()

      Return a singleton instance.
      Returns:
        singleton instance

    - #### getPerf

          public Perf getPerf(String perfName)

      Description copied from interface: `PerfMetricsProvider`
      Retrieve the `Perf` instance for the given name.
      Specified by:
        `getPerf` in interface `PerfMetricsProvider`
      Parameters:
        `perfName` - name of Perf structure
      Returns:
        Perf instance

    - #### addPerfIfAbsent

          public Perf addPerfIfAbsent(String perfName)

      Description copied from interface: `PerfMetricsProvider`
      Add a new performance monitor if one has not existed, else return the existing one.
      Specified by:
        `addPerfIfAbsent` in interface `PerfMetricsProvider`
      Parameters:
        `perfName` - performance monitor name
      Returns:
        Perf instance

    - #### getAllPerfs

          public Collection<Perf> getAllPerfs()

      Description copied from interface: `PerfMetricsProvider`
      Get all `Perf`'s.
      Specified by:
        `getAllPerfs` in interface `PerfMetricsProvider`
      Returns:
        all Perf's

    - #### clearMetrics

          public void clearMetrics(String perfName)

      Description copied from interface: `PerfMetricsProvider`
      Clear all metrics for the given `Perf`'s name.
      Specified by:
        `clearMetrics` in interface `PerfMetricsProvider`
      Parameters:
        `perfName` - name of Perf

    - #### clearPerfs

          public void clearPerfs()

      Description copied from interface: `PerfMetricsProvider`
      Clear all performance measurements. Use with caution!
      Specified by:
        `clearPerfs` in interface `PerfMetricsProvider`

Copyright © 2014. All Rights Reserved.