| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Sweep.Pacing
Description
Pure sweep pacing from measured requests and declared capacity, with quotas taking priority over the target window.
Synopsis
- defaultCycleWindow :: NominalDiffTime -> NominalDiffTime
- nominalPackagePace :: Int -> NominalDiffTime -> Rational
- derivedCapacity :: Rational -> StoreBudget -> StoreBudget
- renderScopeBudget :: SweepPacing -> StoreBudget -> Text
- data PaceDecision = PaceDecision {}
- data BudgetShortfall
- decidePace :: SweepPacing -> StoreBudget -> Maybe (RequestTally, Rational) -> PaceDecision
- renderPaceDecision :: SweepPacing -> PaceDecision -> Maybe Text
The window and the capacity a cycle is paced against
defaultCycleWindow :: NominalDiffTime -> NominalDiffTime Source #
Default window granting each active cycle the same allowance as the pause between cycles.
nominalPackagePace :: Int -> NominalDiffTime -> Rational Source #
The sweep's own nominal package pace, in requests per second. It is the one dial an operator already has over how hard a cycle leans on a store, so both the derived capacity and the share use it.
derivedCapacity :: Rational -> StoreBudget -> StoreBudget Source #
Use the nominal package pace where the backend declares no capacity.
renderScopeBudget :: SweepPacing -> StoreBudget -> Text Source #
Report the resolved capacity, its origin, the share in force, and the per-second ceilings at boot.
The decision the next cycle runs under
data PaceDecision Source #
What one scope's next cycle runs at, and what it cannot reach inside the window.
Constructors
| PaceDecision | |
Fields
| |
Instances
| Show PaceDecision Source # | |
Defined in Ecluse.Core.Registry.Sweep.Pacing Methods showsPrec :: Int -> PaceDecision -> ShowS # show :: PaceDecision -> String # showList :: [PaceDecision] -> ShowS # | |
| Eq PaceDecision Source # | |
Defined in Ecluse.Core.Registry.Sweep.Pacing | |
data BudgetShortfall Source #
Why a cycle cannot be paced inside the window, which the warning names.
Instances
| Show BudgetShortfall Source # | |
Defined in Ecluse.Core.Registry.Sweep.Pacing.Internal Methods showsPrec :: Int -> BudgetShortfall -> ShowS # show :: BudgetShortfall -> String # showList :: [BudgetShortfall] -> ShowS # | |
| Eq BudgetShortfall Source # | |
Defined in Ecluse.Core.Registry.Sweep.Pacing.Internal Methods (==) :: BudgetShortfall -> BudgetShortfall -> Bool # (/=) :: BudgetShortfall -> BudgetShortfall -> Bool # | |
decidePace :: SweepPacing -> StoreBudget -> Maybe (RequestTally, Rational) -> PaceDecision Source #
Pace the next cycle from measured requests and work outside budget waits. With no sample, use the ceiling.
renderPaceDecision :: SweepPacing -> PaceDecision -> Maybe Text Source #
Warn about an unattainable window while the sweep continues at its request ceiling.