ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Composition.MemoryPlan

Description

Resolve independent CPU and metadata ingest controls beside the memory tenants. Tenant accounting guides sizing and shedding. Configured storage bounds retain their override checks, and every control emits a boot-log line.

Synopsis

The plan and its tenants

data MemoryPlan Source #

The resolved plan: every byte-valued bound the composition root builds with, each an explicit config value or its tenant-derived default. Override violations are the one refusal.

Constructors

MemoryPlan 

Fields

Instances

Instances details
Show MemoryPlan Source # 
Instance details

Defined in Ecluse.Composition.MemoryPlan.Types

Eq MemoryPlan Source # 
Instance details

Defined in Ecluse.Composition.MemoryPlan.Types

newtype PublishTenant Source #

The publish tenant: the aggregate byte-admission for concurrently buffered bodies.

Constructors

PublishTenant 

newtype MirrorArtifactTenant Source #

The mirror-artifact tenant, present only when some mount mirrors. The plan charges its heap as matMaxBytes scaled by mirrorArtifactEnvelopeMultiplier.

Constructors

MirrorArtifactTenant 

Fields

  • matMaxBytes :: Int

    The worker's per-artifact fetch byte cap (the tarball bound B).

data QueueTenantDemand Source #

Whether the memory plan owes the in-memory queue a tenant, projected from the backend selection (planMirrorRuntime).

Constructors

NoQueueTenant

No mount mirrors: no queue tenant, no enqueue buffer.

MirroringWithoutMemoryQueue

Mirroring rides a durable backend, so the plan charges the enqueue buffer alone.

MemoryQueueTenant

Mirroring rides the in-memory queue: its depth is a tenant of this plan.

queueTenantDemand :: MirrorRuntimePlan -> QueueTenantDemand Source #

Project the queue-tenant demand from the resolved mirror runtime plan.

data TransientBudget Source #

The budget the boot hands the meter and the sampler, in bytes of live data.

Constructors

TransientBudget 

Fields

Resolution

resolveMemoryPlan :: CacheSettings -> LimitsSettings -> QueueSettings -> Maybe Int -> EffectiveRuntimePlan -> QueueTenantDemand -> Bool -> (MemoryPlan, [Text]) Source #

Resolve the memory plan and its boot lines. The caller selects the mirror-queue backend first, since QueueTenantDemand projects from that choice.

planCacheConfig :: CacheSettings -> MemoryPlan -> CacheConfig Source #

Apply one aggregate bound to eligible stores. Zero floors reserve no static shares.

mirrorArtifactEnvelopeMultiplier :: Int Source #

The transient envelope one mirrored artifact holds, as a multiple of the buffered tarball B. The tarball, its base64 Text, and the publish document coexist at ~3.7x B, rounded up so the peak fits.

mirrorArtifactBytesCap :: Int Source #

The ceiling the plan clamps the computed artifact cap to, and the no-ceiling fallback. The charged envelope is therefore at most this times mirrorArtifactEnvelopeMultiplier.