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
Modifier and Type Method Description HttpRuleSampler.BuilderaddRule(String method, 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 Details
-
addRule
@Deprecated public HttpRuleSampler.Builder addRule(@Nullable String method, String path, float probability)Deprecated.Since 5.8, useputRule(Matcher, Sampler)- Since:
- 4.4
-
putAllRules
Adds or replaces all rules in this sampler with those of the input.- Since:
- 5.8
-
putRule
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
-