| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Maintenance.Budget.Internal
Description
The vocabulary a maintenance budget is written in: the pools a backend meters under, the requests a cycle makes, and the rate one scope runs at. Ecluse.Core.Registry.Maintenance.Budget curates what a caller outside needs of it.
Importing this module opts out of the public surface's stability promises. It exists so a spec can pin each arm against the name a configuration key spells it with.
Synopsis
- data QuotaDimension
- quotaDimensions :: [QuotaDimension]
- quotaDimensionName :: QuotaDimension -> Text
- data RequestKind
- requestKinds :: [RequestKind]
- requestKindName :: RequestKind -> Text
- newtype CyclePace = CyclePace (Map RequestKind Rational)
- freePace :: CyclePace
- paceOf :: Map RequestKind Rational -> CyclePace
- paceSeconds :: CyclePace -> RequestKind -> NominalDiffTime
Documentation
data QuotaDimension Source #
One pool a backend meters its callers by. The arms are pool shapes rather than one vendor's API names, so each backend maps its own calls onto them.
Constructors
| NameListing | Calls that list a store's package names. |
| VersionListing | Calls that list one package's versions. |
| AccountReads | Requests the backend counts as reads of the account holding the store. |
| AccountWrites | Requests the backend counts as writes to that account. |
| TokenReads | Requests sharing the ceiling of one authentication token. |
| StoreRequests | The single undivided request capacity of a backend that publishes no other pool. |
Instances
| Show QuotaDimension Source # | |
Defined in Ecluse.Core.Registry.Maintenance.Budget.Internal Methods showsPrec :: Int -> QuotaDimension -> ShowS # show :: QuotaDimension -> String # showList :: [QuotaDimension] -> ShowS # | |
| Eq QuotaDimension Source # | |
Defined in Ecluse.Core.Registry.Maintenance.Budget.Internal Methods (==) :: QuotaDimension -> QuotaDimension -> Bool # (/=) :: QuotaDimension -> QuotaDimension -> Bool # | |
| Ord QuotaDimension Source # | |
Defined in Ecluse.Core.Registry.Maintenance.Budget.Internal Methods compare :: QuotaDimension -> QuotaDimension -> Ordering # (<) :: QuotaDimension -> QuotaDimension -> Bool # (<=) :: QuotaDimension -> QuotaDimension -> Bool # (>) :: QuotaDimension -> QuotaDimension -> Bool # (>=) :: QuotaDimension -> QuotaDimension -> Bool # max :: QuotaDimension -> QuotaDimension -> QuotaDimension # min :: QuotaDimension -> QuotaDimension -> QuotaDimension # | |
quotaDimensions :: [QuotaDimension] Source #
Every pool this build meters under. quotaDimensionName carries no wildcard and the spec
pins this list, so a new arm fails both until it is named in each.
quotaDimensionName :: QuotaDimension -> Text Source #
The dimension as a configuration key spells it.
data RequestKind Source #
One request a cycle makes against the store being dredged.
Constructors
| ListingPage | One page of the store's package-name listing. |
| VersionPage | One enumeration of a package's versions. |
| ManifestRead | One read of a package's metadata back from the store. |
| DeleteBatch | One destructive call, whatever number of versions the backend takes in it. |
| PermissionRead | One read of a standing permission, including a reassessment before a delete. |
| CursorRead | One read of the walk's resumption marker. |
| CursorWrite | One write or clearing of that marker. |
Instances
| Show RequestKind Source # | |
Defined in Ecluse.Core.Registry.Maintenance.Budget.Internal Methods showsPrec :: Int -> RequestKind -> ShowS # show :: RequestKind -> String # showList :: [RequestKind] -> ShowS # | |
| Eq RequestKind Source # | |
| Ord RequestKind Source # | |
Defined in Ecluse.Core.Registry.Maintenance.Budget.Internal Methods compare :: RequestKind -> RequestKind -> Ordering # (<) :: RequestKind -> RequestKind -> Bool # (<=) :: RequestKind -> RequestKind -> Bool # (>) :: RequestKind -> RequestKind -> Bool # (>=) :: RequestKind -> RequestKind -> Bool # max :: RequestKind -> RequestKind -> RequestKind # min :: RequestKind -> RequestKind -> RequestKind # | |
requestKinds :: [RequestKind] Source #
Every request a cycle can make, held to requestKindName the way quotaDimensions is.
requestKindName :: RequestKind -> Text Source #
The kind as a configuration weight spells it.
What one request of each kind costs its scope in seconds, at the rate a cycle runs.
Constructors
| CyclePace (Map RequestKind Rational) |
freePace :: CyclePace Source #
The pace that imposes no wait, which a scope with no declared capacity runs at.
paceOf :: Map RequestKind Rational -> CyclePace Source #
Build a pace from the seconds each kind is held to.
paceSeconds :: CyclePace -> RequestKind -> NominalDiffTime Source #
The wait one request of this kind takes, which is none where the pace names no cost.