Exemplo n.º 1
0
def expectedCommittedTime(nodeCount):
    """
    From: the requests are prepared
    To: the requests are committed
    """
    count = totalConnections(nodeCount)
    return expectedNodeToNodeMessageDeliveryTime() * count
Exemplo n.º 2
0
def expectedPoolViewChangeStartedTimeout(nodeCount):
    """
    From: the VIEW_CHANGE is send
    To: the view is changed started (before NOMINATE)
    """
    interconnectionCount = totalConnections(nodeCount)
    return expectedNodeToNodeMessageDeliveryTime() * interconnectionCount
Exemplo n.º 3
0
def expectedPropagateTime(nodeCount):
    """
    From: the Client sent the requests
    To: the requests are propageted
    """
    count = totalConnections(nodeCount)
    return expectedNodeToNodeMessageDeliveryTime() * count
Exemplo n.º 4
0
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
Exemplo n.º 5
0
def expectedCommittedTime(nodeCount):
    """
    From: the requests are prepared
    To: the requests are committed
    """
    count = totalConnections(nodeCount)
    return expectedNodeToNodeMessageDeliveryTime() * count
Exemplo n.º 6
0
def expectedPropagateTime(nodeCount):
    """
    From: the Client sent the requests
    To: the requests are propageted
    """
    count = totalConnections(nodeCount)
    return expectedNodeToNodeMessageDeliveryTime() * count
Exemplo n.º 7
0
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
Exemplo n.º 8
0
def expectedPoolViewChangeStartedTimeout(nodeCount):
    """
    From: the VIEW_CHANGE is send
    To: the view is changed started (before NOMINATE)
    """
    interconnectionCount = totalConnections(nodeCount)
    return expectedNodeToNodeMessageDeliveryTime() * interconnectionCount
Exemplo n.º 9
0
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
Exemplo n.º 10
0
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
Exemplo n.º 11
0
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)
Exemplo n.º 12
0
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)