- java.lang.Object
-
- brave.http.HttpRuleSampler.Builder
-
- Enclosing class:
- HttpRuleSampler
public static final class HttpRuleSampler.Builder extends java.lang.Object- Since:
- 4.4
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HttpRuleSampler.BuilderaddRule(java.lang.String method, java.lang.String path, float probability)Deprecated.Since 5.8, useputRule(Matcher, Sampler)HttpRuleSamplerbuild()HttpRuleSampler.BuilderputAllRules(HttpRuleSampler sampler)Adds or replaces all rules in this sampler with those of the input.HttpRuleSampler.BuilderputRule(Matcher<HttpRequest> matcher, Sampler sampler)Adds or replaces the sampler for the matcher.
-
-
-
Method Detail
-
addRule
@Deprecated public HttpRuleSampler.Builder addRule(@Nullable java.lang.String method, java.lang.String path, float probability)
Deprecated.Since 5.8, useputRule(Matcher, Sampler)- Since:
- 4.4
-
putAllRules
public HttpRuleSampler.Builder putAllRules(HttpRuleSampler sampler)
Adds or replaces all rules in this sampler with those of the input.- Since:
- 5.8
-
putRule
public HttpRuleSampler.Builder putRule(Matcher<HttpRequest> matcher, Sampler sampler)
Adds or replaces the sampler for the matcher.Ex.
import static brave.http.HttpRequestMatchers.pathStartsWith; builder.putRule(pathStartsWith("/api"), RateLimitingSampler.create(10));- Since:
- 5.8
-
build
public HttpRuleSampler build()
-
-