Class SamplingRule
java.lang.Object
com.amazonaws.xray.strategy.sampling.rule.SamplingRule
-
Constructor Summary
ConstructorsConstructorDescriptionSamplingRule
(String host, String serviceName, String httpMethod, String urlPath, int fixedTarget, float rate) Constructs a newSamplingRule
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether or not this sampling rule applies to the incoming request based on some of the request's parameters.int
@Nullable String
getHost()
@Nullable String
float
getRate()
@Nullable String
@Nullable String
void
setFixedTarget
(int fixedTarget) void
void
setHttpMethod
(String httpMethod) void
setRate
(float rate) void
setServiceName
(String serviceName) void
setUrlPath
(String urlPath) toString()
-
Constructor Details
-
SamplingRule
public SamplingRule() -
SamplingRule
public SamplingRule(String host, String serviceName, String httpMethod, String urlPath, int fixedTarget, float rate) Constructs a newSamplingRule
. Patterns are supported in thehost
,httpMethod
, andurlPath
parameters. Patterns are matched using theSearchPattern
class.- Parameters:
host
- the host name for which the rule should applyserviceName
- the service name for which the rule should applyhttpMethod
- the http method for which the rule should applyurlPath
- the urlPath for which the rule should applyfixedTarget
- the number of traces per any given second for which the sampling rule will samplerate
- the rate at which the rule should sample, after the fixedTarget has been reached
-
-
Method Details
-
getServiceName
- Returns:
- the serviceName
-
setServiceName
- Parameters:
serviceName
- the serviceName to set
-
getHost
- Returns:
- the host
-
setHost
- Parameters:
host
- the host to set
-
getHttpMethod
- Returns:
- the httpMethod
-
setHttpMethod
- Parameters:
httpMethod
- the httpMethod to set
-
getUrlPath
- Returns:
- the urlPath
-
setUrlPath
- Parameters:
urlPath
- the urlPath to set
-
getFixedTarget
public int getFixedTarget()- Returns:
- the fixedTarget
-
setFixedTarget
public void setFixedTarget(int fixedTarget) - Parameters:
fixedTarget
- the fixedTarget to set
-
getRate
public float getRate()- Returns:
- the rate
-
setRate
public void setRate(float rate) - Parameters:
rate
- the rate to set
-
getReservoir
- Returns:
- the reservoir
-
toString
-
appliesTo
Determines whether or not this sampling rule applies to the incoming request based on some of the request's parameters. Any null parameters provided will be considered an implicit match. For example,appliesTo(null, null, null)
will always returntrue
, for any rule.- Parameters:
requestHost
- the host name for the incoming request.requestPath
- the path from the incoming requestrequestMethod
- the method used to make the incoming request- Returns:
- whether or not this rule applies to the incoming request
-