Package brave.http
Class HttpRuleSampler.Builder
- java.lang.Object
-
- brave.http.HttpRuleSampler.Builder
-
- Enclosing class:
- HttpRuleSampler
public static final class HttpRuleSampler.Builder extends Object
- Since:
- 4.4
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HttpRuleSampler.Builder
addRule(String method, String path, float probability)
Deprecated.Since 5.8, useputRule(Matcher, Sampler)
HttpRuleSampler
build()
HttpRuleSampler.Builder
putAllRules(HttpRuleSampler sampler)
Adds or replaces all rules in this sampler with those of the input.HttpRuleSampler.Builder
putRule(Matcher<HttpRequest> matcher, Sampler sampler)
Adds or replaces the sampler for the matcher.
-
-
-
Method Detail
-
addRule
@Deprecated public HttpRuleSampler.Builder addRule(@Nullable String method, 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()
-
-