Class SamplingPolicies

java.lang.Object
com.tnsai.quality.sampling.SamplingPolicies

public final class SamplingPolicies extends Object
Convenience factories for the bundled EventSamplingPolicy implementations (issue #82).

Three named "shapes" capture the most common operator intents without requiring them to think about per-level rates upfront:

Operators with custom volume profiles construct the underlying policy directly with their own rates.

Since:
0.9.0 (issue #82)
  • Method Details

    • verbose

      public static EventSamplingPolicy verbose()
      Capture every event; recommended for dev / staging / single tenant.
    • defaults

      public static EventSamplingPolicy defaults()
      Production default — priority-aware: CRITICAL/ERROR/WARN always, INFO at 10%, DEBUG at 1%. Best when an agent's INFO and DEBUG carry meaningfully different volumes.
    • production

      public static EventSamplingPolicy production()
      Strict production — WARN+ always captured, INFO + DEBUG sampled at 10%. Best when "is this a problem?" is the only distinction that matters.