Class SLABuilder<P>

java.lang.Object
io.hyperfoil.api.config.SLABuilder<P>
All Implemented Interfaces:
BuilderBase<SLABuilder<P>>

public class SLABuilder<P> extends Object implements BuilderBase<SLABuilder<P>>
Defines a Service Level Agreement (SLA) - conditions that must hold for benchmark to be deemed successful.
  • Field Details

    • DEFAULT

      public static final SLA[] DEFAULT
  • Constructor Details

    • SLABuilder

      public SLABuilder(P parent)
  • Method Details

    • prepareBuild

      public void prepareBuild()
      Specified by:
      prepareBuild in interface BuilderBase<P>
    • build

      public SLA build()
    • endSLA

      public P endSLA()
    • window

      public SLABuilder<P> window(long window, TimeUnit timeUnit)
    • window

      public SLABuilder<P> window(String window)
      Period over which the stats should be collected. By default the SLA applies to stats from whole phase.
      Parameters:
      window - Window size with suffix ('s', 'm' or 'h') or just in milliseconds.
      Returns:
      Self.
    • errorRatio

      public SLABuilder<P> errorRatio(double errorRatio)
      Maximum allowed ratio of errors: connection failures or resets, timeouts and internal errors. Valid values are 0.0 - 1.0 (inclusive). Note: 4xx and 5xx statuses are NOT considered errors for this SLA parameter. Use invalidRatio for that.
      Parameters:
      errorRatio - Ratio.
      Returns:
      Self.
    • invalidRatio

      public SLABuilder<P> invalidRatio(double invalidRatio)
      Maximum allowed ratio of requests with responses marked as invalid. Valid values are 0.0 - 1.0 (inclusive). Note: With default settings 4xx and 5xx statuses are considered invalid. Check out ergonomics.autoRangeCheck or httpRequest.handler.autoRangeCheck to change this.
      Parameters:
      invalidRatio - Ratio.
      Returns:
      Self.
    • meanResponseTime

      public SLABuilder<P> meanResponseTime(long meanResponseTime, TimeUnit timeUnit)
    • meanResponseTime

      public SLABuilder<P> meanResponseTime(String meanResponseTime)
      Maximum allowed mean (average) response time. Use suffix `ns`, `us`, `ms` or `s` to specify units.
      Parameters:
      meanResponseTime - Mean response time.
      Returns:
      Self.
    • blockedRatio

      public SLABuilder<P> blockedRatio(double blockedRatio)
      Maximum allowed ratio of time spent waiting for usable connection to sum of response latencies and blocked time. Default is 0 - client must not be blocked. Set to 1 if the client can block without limits.
      Parameters:
      blockedRatio - Maximum ratio.
      Returns:
      Self.
    • limits

      public SLABuilder<P>.LimitsBuilder limits()
      Percentile limits.
      Returns:
      Builder.