Class CentralizedRule

java.lang.Object
com.amazonaws.xray.strategy.sampling.rule.CentralizedRule
All Implemented Interfaces:
Rule, Comparable<CentralizedRule>

public class CentralizedRule extends Object implements Rule, Comparable<CentralizedRule>
Represents a customer-defined sampling rule. A rule contains the matchers required to determine if an incoming request can use the rule, and sampling targets which determine the sampling behavior once a request has been matched. A rule also maintains usage statistics which are periodically reported to X-Ray.
  • Field Details

  • Constructor Details

    • CentralizedRule

      public CentralizedRule(com.amazonaws.services.xray.model.SamplingRule input, Rand rand)
  • Method Details

    • update

      public boolean update(com.amazonaws.services.xray.model.SamplingRule i)
    • isStale

      public boolean isStale(Instant now)
    • isValid

      public static boolean isValid(com.amazonaws.services.xray.model.SamplingRule rule)
    • update

      public void update(com.amazonaws.services.xray.model.SamplingTargetDocument t, Instant now)
    • snapshot

      public com.amazonaws.services.xray.model.SamplingStatisticsDocument snapshot(Date now)
    • match

      public boolean match(SamplingRequest r)
    • sample

      public SamplingResponse sample(Instant now)
      Specified by:
      sample in interface Rule
    • compareTo

      public int compareTo(CentralizedRule other)
      Specified by:
      compareTo in interface Comparable<CentralizedRule>
    • getName

      public String getName()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object