Package io.hyperfoil.api.config
Class SLABuilder<P>
- java.lang.Object
-
- io.hyperfoil.api.config.SLABuilder<P>
-
- All Implemented Interfaces:
BuilderBase<SLABuilder<P>>
public class SLABuilder<P> extends java.lang.Object implements BuilderBase<SLABuilder<P>>
Defines a Service Level Agreement (SLA) - conditions that must hold for benchmark to be deemed successful.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSLABuilder.LimitsBuilderPercentile limits.static classSLABuilder.ListBuilder<P>Defines a list of Service Level Agreements (SLAs) - conditions that must hold for benchmark to be deemed successful.-
Nested classes/interfaces inherited from interface io.hyperfoil.api.config.BuilderBase
BuilderBase.CopyUtil, BuilderBase.IgnoreCopy, BuilderBase.ThrowingSupplier<T>
-
-
Constructor Summary
Constructors Constructor Description SLABuilder(P parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SLABuilder<P>blockedRatio(double blockedRatio)Maximum allowed ratio of time spent waiting for usable connection to sum of response latencies and blocked time.SLAbuild()PendSLA()SLABuilder<P>errorRatio(double errorRatio)Maximum allowed ratio of errors: connection failures or resets, timeouts and internal errors.SLABuilder<P>invalidRatio(double invalidRatio)Maximum allowed ratio of requests with responses marked as invalid.SLABuilder.LimitsBuilderlimits()Percentile limits.SLABuilder<P>meanResponseTime(long meanResponseTime, java.util.concurrent.TimeUnit timeUnit)SLABuilder<P>meanResponseTime(java.lang.String meanResponseTime)Maximum allowed mean (average) response time.voidprepareBuild()SLABuilder<P>window(long window, java.util.concurrent.TimeUnit timeUnit)SLABuilder<P>window(java.lang.String window)Period over which the stats should be collected.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.hyperfoil.api.config.BuilderBase
copy
-
-
-
-
Field Detail
-
DEFAULT
public static final SLA[] DEFAULT
-
-
Constructor Detail
-
SLABuilder
public SLABuilder(P parent)
-
-
Method Detail
-
prepareBuild
public void prepareBuild()
- Specified by:
prepareBuildin interfaceBuilderBase<P>
-
build
public SLA build()
-
endSLA
public P endSLA()
-
window
public SLABuilder<P> window(long window, java.util.concurrent.TimeUnit timeUnit)
-
window
public SLABuilder<P> window(java.lang.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. UseinvalidRatiofor 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 outergonomics.autoRangeCheckorhttpRequest.handler.autoRangeCheckto change this.- Parameters:
invalidRatio- Ratio.- Returns:
- Self.
-
meanResponseTime
public SLABuilder<P> meanResponseTime(long meanResponseTime, java.util.concurrent.TimeUnit timeUnit)
-
meanResponseTime
public SLABuilder<P> meanResponseTime(java.lang.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.LimitsBuilder limits()
Percentile limits.- Returns:
- Builder.
-
-