module Ecluse.Composition.MemoryPlan.Bounds (
runtimeReserveShareDiv,
runtimeReserveFloorBytes,
cacheSharePercent,
publishSharePercent,
queueSharePercent,
mirrorArtifactSharePercent,
responseBytesFallback,
requestBytesFloor,
requestBytesCap,
requestBytesFallback,
cacheBytesFloor,
cacheBytesCap,
cacheBytesFallback,
cacheEntryExpectedBytes,
cacheEntriesFloor,
cacheEntriesCap,
queueDepthFloor,
queueDepthCap,
queueDepthFallback,
publishAggregateFallbackRequests,
mirrorArtifactEnvelopeMultiplier,
mirrorArtifactBytesCap,
queueCharge,
fixedBufferBytes,
anyMountMirrors,
memoryQueueCharged,
) where
import Ecluse.Composition.MemoryPlan.Types (QueueTenantDemand (MemoryQueueTenant, NoQueueTenant))
import Ecluse.Composition.Sizing (mirrorEnqueueBufferDepth)
import Ecluse.Core.Security.Limits (Limits (maxMetadataBytes), defaultLimits)
import Ecluse.Core.Server.MemoryModel (mirrorJobEstimatedBytes)
runtimeReserveShareDiv :: Int
runtimeReserveShareDiv :: Int
runtimeReserveShareDiv = Int
5
runtimeReserveFloorBytes :: Int
runtimeReserveFloorBytes :: Int
runtimeReserveFloorBytes = Int
33554432
cacheSharePercent :: Int
cacheSharePercent :: Int
cacheSharePercent = Int
30
publishSharePercent :: Int
publishSharePercent :: Int
publishSharePercent = Int
15
queueSharePercent :: Int
queueSharePercent :: Int
queueSharePercent = Int
5
mirrorArtifactSharePercent :: Int
mirrorArtifactSharePercent :: Int
mirrorArtifactSharePercent = Int
4
responseBytesFallback :: Int
responseBytesFallback :: Int
responseBytesFallback = Limits -> Int
maxMetadataBytes Limits
defaultLimits
requestBytesFloor :: Int
requestBytesFloor :: Int
requestBytesFloor = Int
26214400
requestBytesCap :: Int
requestBytesCap :: Int
requestBytesCap = Int
104857600
requestBytesFallback :: Int
requestBytesFallback :: Int
requestBytesFallback = Int
26214400
cacheBytesFloor :: Int
cacheBytesFloor :: Int
cacheBytesFloor = Int
67108864
cacheBytesCap :: Int
cacheBytesCap :: Int
cacheBytesCap = Int
1073741824
cacheBytesFallback :: Int
cacheBytesFallback :: Int
cacheBytesFallback = Int
268435456
cacheEntryExpectedBytes :: Int
cacheEntryExpectedBytes :: Int
cacheEntryExpectedBytes = Int
16384
cacheEntriesFloor :: Int
cacheEntriesFloor :: Int
cacheEntriesFloor = Int
256
cacheEntriesCap :: Int
cacheEntriesCap :: Int
cacheEntriesCap = Int
65536
queueDepthFloor :: Int
queueDepthFloor :: Int
queueDepthFloor = Int
5000
queueDepthCap :: Int
queueDepthCap :: Int
queueDepthCap = Int
100000
queueDepthFallback :: Int
queueDepthFallback :: Int
queueDepthFallback = Int
50000
publishAggregateFallbackRequests :: Int
publishAggregateFallbackRequests :: Int
publishAggregateFallbackRequests = Int
4
mirrorArtifactEnvelopeMultiplier :: Int
mirrorArtifactEnvelopeMultiplier :: Int
mirrorArtifactEnvelopeMultiplier = Int
4
mirrorArtifactBytesCap :: Int
mirrorArtifactBytesCap :: Int
mirrorArtifactBytesCap = Int
512 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
1024 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
1024
queueCharge :: Bool -> Int -> Int
queueCharge :: Bool -> Int -> Int
queueCharge Bool
memoryBacked Int
d = if Bool
memoryBacked then Int
d Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
mirrorJobEstimatedBytes else Int
0
fixedBufferBytes :: QueueTenantDemand -> Int
fixedBufferBytes :: QueueTenantDemand -> Int
fixedBufferBytes QueueTenantDemand
demand
| QueueTenantDemand -> Bool
anyMountMirrors QueueTenantDemand
demand = Int
mirrorEnqueueBufferDepth Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
mirrorJobEstimatedBytes
| Bool
otherwise = Int
0
anyMountMirrors :: QueueTenantDemand -> Bool
anyMountMirrors :: QueueTenantDemand -> Bool
anyMountMirrors = (QueueTenantDemand -> QueueTenantDemand -> Bool
forall a. Eq a => a -> a -> Bool
/= QueueTenantDemand
NoQueueTenant)
memoryQueueCharged :: QueueTenantDemand -> Bool
memoryQueueCharged :: QueueTenantDemand -> Bool
memoryQueueCharged = (QueueTenantDemand -> QueueTenantDemand -> Bool
forall a. Eq a => a -> a -> Bool
== QueueTenantDemand
MemoryQueueTenant)