Interface MetricsAssertHelper

All Known Implementing Classes:
MetricsAssertHelperImpl

public interface MetricsAssertHelper
Interface of a class to make assertions about metrics values.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assertCounter(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a counter exists and that it's value is equal to the expected value.
    void
    assertCounterGt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a counter exists and that it's value is greater than the given value.
    void
    assertCounterLt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a counter exists and that it's value is less than the given value.
    void
    assertGauge(String name, double expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a gauge exists and that it's value is equal to the expected value.
    void
    assertGauge(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a gauge exists and that it's value is equal to the expected value.
    void
    assertGaugeGt(String name, double expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a gauge exists and it's value is greater than a given value
    void
    assertGaugeGt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a gauge exists and it's value is greater than a given value
    void
    assertGaugeLt(String name, double expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a gauge exists and it's value is less than a given value
    void
    assertGaugeLt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a gauge exists and it's value is less than a given value
    void
    assertTag(String name, String expected, org.apache.hadoop.hbase.metrics.BaseSource source)
    Assert that a tag exists and has a given value.
    boolean
    checkCounterExists(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
    Check if a dynamic counter exists.
    boolean
    checkGaugeExists(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
    Check if a gauge exists.
    long
    getCounter(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
    Get the value of a counter.
    double
    getGaugeDouble(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
    Get the value of a gauge as a double.
    long
    getGaugeLong(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
    Get the value of a gauge as a long.
    void
    Init helper.
    toDebugString(org.apache.hadoop.hbase.metrics.BaseSource source)
    Generates a representation of all metrics exported by the given source.
  • Method Details

    • init

      void init()
      Init helper. This method will make sure that the metrics system is set up for tests.
    • assertTag

      void assertTag(String name, String expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a tag exists and has a given value.
      Parameters:
      name - The name of the tag.
      expected - The expected value
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertGauge

      void assertGauge(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a gauge exists and that it's value is equal to the expected value.
      Parameters:
      name - The name of the gauge
      expected - The expected value of the gauge.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertGaugeGt

      void assertGaugeGt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a gauge exists and it's value is greater than a given value
      Parameters:
      name - The name of the gauge
      expected - Value that the gauge is expected to be greater than
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertGaugeLt

      void assertGaugeLt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a gauge exists and it's value is less than a given value
      Parameters:
      name - The name of the gauge
      expected - Value that the gauge is expected to be less than
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertGauge

      void assertGauge(String name, double expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a gauge exists and that it's value is equal to the expected value.
      Parameters:
      name - The name of the gauge
      expected - The expected value of the gauge.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertGaugeGt

      void assertGaugeGt(String name, double expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a gauge exists and it's value is greater than a given value
      Parameters:
      name - The name of the gauge
      expected - Value that the gauge is expected to be greater than
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertGaugeLt

      void assertGaugeLt(String name, double expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a gauge exists and it's value is less than a given value
      Parameters:
      name - The name of the gauge
      expected - Value that the gauge is expected to be less than
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertCounter

      void assertCounter(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a counter exists and that it's value is equal to the expected value.
      Parameters:
      name - The name of the counter.
      expected - The expected value
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertCounterGt

      void assertCounterGt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a counter exists and that it's value is greater than the given value.
      Parameters:
      name - The name of the counter.
      expected - The value the counter is expected to be greater than.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • assertCounterLt

      void assertCounterLt(String name, long expected, org.apache.hadoop.hbase.metrics.BaseSource source)
      Assert that a counter exists and that it's value is less than the given value.
      Parameters:
      name - The name of the counter.
      expected - The value the counter is expected to be less than.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
    • getCounter

      long getCounter(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
      Get the value of a counter.
      Parameters:
      name - name of the counter.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
      Returns:
      long value of the counter.
    • checkCounterExists

      boolean checkCounterExists(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
      Check if a dynamic counter exists.
      Parameters:
      name - name of the counter.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
      Returns:
      boolean true if counter metric exists.
    • checkGaugeExists

      boolean checkGaugeExists(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
      Check if a gauge exists.
      Parameters:
      name - name of the gauge.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
      Returns:
      boolean true if gauge metric exists.
    • getGaugeDouble

      double getGaugeDouble(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
      Get the value of a gauge as a double.
      Parameters:
      name - name of the gauge.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
      Returns:
      double value of the gauge.
    • getGaugeLong

      long getGaugeLong(String name, org.apache.hadoop.hbase.metrics.BaseSource source)
      Get the value of a gauge as a long.
      Parameters:
      name - name of the gauge.
      source - The BaseSourceBaseSource that will provide the tags, gauges, and counters.
      Returns:
      long value of the gauge.
    • toDebugString

      String toDebugString(org.apache.hadoop.hbase.metrics.BaseSource source)
      Generates a representation of all metrics exported by the given source.
      Parameters:
      source - The BaseSource that will provide the metrics.
      Returns:
      A representation of the metrics as a String.