Package org.apache.hadoop.hbase.test
Interface MetricsAssertHelper
- All Known Implementing Classes:
- MetricsAssertHelperImpl
public interface MetricsAssertHelper
Interface of a class to make assertions about metrics values.
- 
Method SummaryModifier and TypeMethodDescriptionvoidassertCounter(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.voidassertCounterGt(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.voidassertCounterLt(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.voidassertGauge(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.voidassertGauge(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.voidassertGaugeGt(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 valuevoidassertGaugeGt(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 valuevoidassertGaugeLt(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 valuevoidassertGaugeLt(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 valuevoidAssert that a tag exists and has a given value.booleancheckCounterExists(String name, org.apache.hadoop.hbase.metrics.BaseSource source) Check if a dynamic counter exists.booleancheckGaugeExists(String name, org.apache.hadoop.hbase.metrics.BaseSource source) Check if a gauge exists.longgetCounter(String name, org.apache.hadoop.hbase.metrics.BaseSource source) Get the value of a counter.doublegetGaugeDouble(String name, org.apache.hadoop.hbase.metrics.BaseSource source) Get the value of a gauge as a double.longgetGaugeLong(String name, org.apache.hadoop.hbase.metrics.BaseSource source) Get the value of a gauge as a long.voidinit()Init helper.toDebugString(org.apache.hadoop.hbase.metrics.BaseSource source) Generates a representation of all metrics exported by the givensource.
- 
Method Details- 
initvoid init()Init helper. This method will make sure that the metrics system is set up for tests.
- 
assertTagAssert that a tag exists and has a given value.- Parameters:
- name- The name of the tag.
- expected- The expected value
- source- The BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertGaugeAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertGaugeGtAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertGaugeLtAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertGaugeAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertGaugeGtAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertGaugeLtAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertCounterAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertCounterGtAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
assertCounterLtAssert 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 BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
 
- 
getCounterGet the value of a counter.- Parameters:
- name- name of the counter.
- source- The BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
- Returns:
- long value of the counter.
 
- 
checkCounterExistsCheck if a dynamic counter exists.- Parameters:
- name- name of the counter.
- source- The BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
- Returns:
- boolean true if counter metric exists.
 
- 
checkGaugeExistsCheck if a gauge exists.- Parameters:
- name- name of the gauge.
- source- The BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
- Returns:
- boolean true if gauge metric exists.
 
- 
getGaugeDoubleGet the value of a gauge as a double.- Parameters:
- name- name of the gauge.
- source- The BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
- Returns:
- double value of the gauge.
 
- 
getGaugeLongGet the value of a gauge as a long.- Parameters:
- name- name of the gauge.
- source- The BaseSource- BaseSourcethat will provide the tags, gauges, and counters.
- Returns:
- long value of the gauge.
 
- 
toDebugStringGenerates a representation of all metrics exported by the givensource.- Parameters:
- source- The- BaseSourcethat will provide the metrics.
- Returns:
- A representation of the metrics as a String.
 
 
-