ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

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

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.

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.

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.

newtype CyclePace Source #

What one request of each kind costs its scope in seconds, at the rate a cycle runs.

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.