qbits.alia.policy.speculative-execution
cluster-wide-percentile-tracker
(cluster-wide-percentile-tracker {:keys [highest-trackable-latency-millis], :as opts})
A PercentileTracker
that aggregates all measurements into a single histogram.
This gives you global latency percentiles for the whole cluster, meaning that latencies of slower hosts will tend to appear in higher percentiles.
constant-speculative-execution-policy
(constant-speculative-execution-policy constant-delay-ms max-speculative-executions)
A SpeculativeExecutionPolicy that schedules a given number of speculative executions, separated by a fixed delay.
map->constant-speculative-execution-policy
(map->constant-speculative-execution-policy {:keys [constant-delay-millis max-speculative-executions]})
map->percentile-speculative-execution-policy
(map->percentile-speculative-execution-policy tracker {:keys [percentile max-executions]})
no-speculative-execution-policy
(no-speculative-execution-policy)
A SpeculativeExecutionPolicy that never schedules speculative executions.
per-host-percentile-tracker
(per-host-percentile-tracker {:keys [highest-trackable-latency-millis], :as opts})
A PercentileTracker
that maintains a separate histogram for each host.
This gives you per-host latency percentiles, meaning that each host will only be compared to itself.
percentile-speculative-execution-policy
(percentile-speculative-execution-policy percentile-tracker percentile max-speculative-executions)
A policy that triggers speculative executions when the request to the current host is above a given percentile. This class uses a PerHostPercentileTracker that must be registered with the cluster instance
percentile-tracker
(percentile-tracker builder {:keys [interval min-recorded-values significant-value-digits]})
A LatencyTracker
that records query latencies over a sliding time interval, and exposes an API to retrieve the latency at a given percentile.
It uses HdrHistogram
to record latencies: for each category, there is a “live” histogram where current latencies are recorded, and a “cached”, read-only histogram that is used when clients call getLatencyAtPercentile(Host, Statement, Exception, double)
. Each time the cached histogram becomes older than the interval, the two histograms are switched. Statistics will not be available during the first interval at cluster startup, since we don’t have a cached histogram yet.