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 Modifier and Type Method Description HttpRuleSamplerbuild()HttpRuleSampler.BuilderputAllRules(HttpRuleSampler sampler)Adds or replaces all rules in this sampler with those of the input.HttpRuleSampler.BuilderputRule(brave.sampler.Matcher<HttpRequest> matcher, brave.sampler.Sampler sampler)Adds or replaces the sampler for the matcher.
-
-
-
Method Detail
-
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(brave.sampler.Matcher<HttpRequest> matcher, brave.sampler.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()
-
-