diff --git a/app/Main.hs b/app/Main.hs index 24d66a9..043d123 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -31,6 +31,7 @@ readConfig = do -- waiting for timeout let speedup = read speedupString + statsEvalD = 120 * 10^6 `div` speedup confBootstrapNodes' = case remainingArgs of bootstrapHost : bootstrapPortString : _ -> [(bootstrapHost, read bootstrapPortString)] @@ -52,6 +53,7 @@ readConfig = do , confKChoicesOverload = 0.9 , confKChoicesUnderload = 0.1 , confKChoicesMaxVS = 8 + , confKChoicesRebalanceInterval = round (realToFrac statsEvalD * 1.1 :: Double) } sConf = ServiceConf { confSubscriptionExpiryTime = 24*3600 / fromIntegral speedup @@ -59,7 +61,7 @@ readConfig = do , confServiceHost = confDomainString , confLogfilePath = "../simulationData/logs/" <> confDomainString <> ".log" , confSpeedupFactor = speedup - , confStatsEvalDelay = 120 * 10^6 `div` speedup + , confStatsEvalDelay = statsEvalD } pure (fConf, sConf) diff --git a/src/Hash2Pub/FediChordTypes.hs b/src/Hash2Pub/FediChordTypes.hs index 3852bd1..3a954d1 100644 --- a/src/Hash2Pub/FediChordTypes.hs +++ b/src/Hash2Pub/FediChordTypes.hs @@ -459,6 +459,8 @@ data FediChordConf = FediChordConf -- ^ fraction of capacity below which a node considers itself underloaded , confKChoicesMaxVS :: Word8 -- ^ upper limit of vserver index κ + , confKChoicesRebalanceInterval :: Int + -- ^ interval between vserver rebalance attempts } deriving (Show, Eq)