Class ValueFilter

java.lang.Object
com.codahale.metrics.riemann.ValueFilter

public class ValueFilter extends Object
Filters values to determine if they fall into a given range via the applies(double) method. Ranges are intervals, with endpoint inclusion configurable. The state property implicitly binds values in the represented range to that state for reporting.

Instances are created using ValueFilter.Builder. Endpoints not specified default to positive or negative infinity, respectively. For example, new ValueFilter.Builder("critical").withLower(50).build()) creates a ValueFilter instance that binds "critical" to all values greater than or equal to 50 and new ValueFilter.Builder("warn") .withUpperExclusive(300) .withLower(100).build()) creates an instance binding "warn" to values greater than or equal to 100 and strictly less than 300.

  • Method Details

    • applies

      public boolean applies(double value)
      Determine whether or not the given value falls within the range associated with this ValueFilter.
      Parameters:
      value - value to test
      Returns:
      true iff value is within the target interval
    • getState

      public String getState()
      Returns:
      the state bound to values in this ValueFilter