def expectedCommittedTime(nodeCount): """ From: the requests are prepared To: the requests are committed """ count = totalConnections(nodeCount) return expectedNodeToNodeMessageDeliveryTime() * count
def expectedPoolViewChangeStartedTimeout(nodeCount): """ From: the VIEW_CHANGE is send To: the view is changed started (before NOMINATE) """ interconnectionCount = totalConnections(nodeCount) return expectedNodeToNodeMessageDeliveryTime() * interconnectionCount
def expectedPropagateTime(nodeCount): """ From: the Client sent the requests To: the requests are propageted """ count = totalConnections(nodeCount) return expectedNodeToNodeMessageDeliveryTime() * count
def expectedPoolNominationTimeout(nodeCount): """ From: the NOMINATE is sent To: the NOMINATE is received by each node in the Pool """ interconnectionCount = totalConnections(nodeCount) return expectedNodeToNodeMessageDeliveryTime() * interconnectionCount
def expectedPoolElectionTimeout(nodeCount, numOfReelections=0): """ From: the Pool ready for the view change procedure To: the Pool changed the View """ # not sure what nomination + primary is enough interconnectionCount = totalConnections(nodeCount) primarySelectTimeout = \ expectedNodeToNodeMessageDeliveryTime() * interconnectionCount oneElectionTimeout = \ expectedPoolViewChangeStartedTimeout(nodeCount) + \ expectedPoolNominationTimeout(nodeCount) + \ primarySelectTimeout return (1 + numOfReelections) * oneElectionTimeout
def expectedPoolInterconnectionTime(nodeCount): """ From: the Pool up To: the Pool is fully connected """ interconnectionCount = totalConnections(nodeCount) nodeConnectionTimeout = config.ExpectedConnectTime # '+KITZStack.RETRY_TIMEOUT_RESTRICTED' is a workaround for # bug (`'str' object has no attribute 'keys'`) which supposed to be # fixed in the 3pcbatch feature # https://evernym.atlassian.net/browse/SOV-995 # multiply by 2 because we need to re-create connections which can be done on a second re-try only # (we may send pings on some of the re-tries) return min( 0.8 * config.TestRunningTimeLimitSec, interconnectionCount * nodeConnectionTimeout + 2 * config.RETRY_TIMEOUT_RESTRICTED + 2)
def expectedPoolInterconnectionTime(nodeCount): """ From: the Pool up To: the Pool is fully connected """ config = getConfig() interconnectionCount = totalConnections(nodeCount) nodeConnectionTimeout = config.ExpectedConnectTime # '+KITZStack.RETRY_TIMEOUT_RESTRICTED' is a workaround for # bug (`'str' object has no attribute 'keys'`) which supposed to be # fixed in the 3pcbatch feature # https://evernym.atlassian.net/browse/SOV-995 # TODO check actual state # multiply by 2 because we need to re-create connections which can be done on a second re-try only # (we may send pings on some of the re-tries) return min(0.8 * config.TestRunningTimeLimitSec, interconnectionCount * nodeConnectionTimeout + 2 * config.RETRY_TIMEOUT_RESTRICTED + 2)