_globals.update({'threads': lthreads, 'result_queue': resqueue})
-def start_write_transactions_on_nodes(host_list, prefix_list, id_prefix, duration, rate, chained_flag=False):
+def start_write_transactions_on_nodes(host_list, prefix_list, id_prefix, duration, rate, chained_flag=False,
+ reset_globals=True):
"""Invoke write-transactions rpc on given nodes.
:param host_list: list of ip address of odl nodes
:type rate: int
:param chained_flag: specify chained vs. simple transactions
:type chained_flag: bool
+ :param reset_globals: reset global variable dict
+ :type reset_globals: bool
"""
+ if reset_globals:
+ _globals.clear()
+
logger.info(
"Input parameters: host_list:{}, prefix_list:{}, id_prefix:{}, duration:{}, rate:{}, chained_flag:{}".format(
host_list, prefix_list, id_prefix, duration, rate, chained_flag))
def start_produce_transactions_on_nodes(host_list, prefix_list, id_prefix,
- duration, rate, isolated_transactions_flag=True):
+ duration, rate, isolated_transactions_flag=True, reset_globals=True):
"""Invoke produce-transactions rpcs on given nodes.
:param host_list: list of ip address of odl nodes
:type rate: int
:param isolated_transactions_flag: isolated transactions flag
:type isolated_transactions_flag: bool
+ :param reset_globals: reset global variable dict
+ :type reset_globals: bool
"""
+ if reset_globals:
+ _globals.clear()
+
msg = "host_list:{}, prefix_list:{} ,id_prefix:{}, duration:{}, rate:{}, isolated_transactions:{}".format(
host_list, prefix_list, id_prefix, duration, rate, isolated_transactions_flag)
msg = "Input parameters: " + msg
${restart_producer_node_ip} = ClusterManagement.Resolve_IP_Address_For_Member ${isolated_node}
${restart_producer_node_ip_as_list} BuiltIn.Create_List ${restart_producer_node_ip}
MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${restart_producer_node_ip_as_list} ${restart_producer_node_idx_as_list} ${ID_PREFIX} ${time_to_finish} ${TRANSACTION_RATE_1K} chained_flag=${CHAINED_TX}
+ ... reset_globals=${False}
${resp_list} = MdsalLowlevelPy.Wait_For_Transactions
: FOR ${resp} IN @{resp_list}
\ TemplatedRequests.Check_Status_Code ${resp}
${restart_producer_node_idx_as_list} BuiltIn.Create_List ${isolated_node}
${restart_producer_node_ip} = ClusterManagement.Resolve_IP_Address_For_Member ${isolated_node}
${restart_producer_node_ip_as_list} BuiltIn.Create_List ${restart_producer_node_ip}
- MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes ${restart_producer_node_ip_as_list} ${restart_producer_node_idx_as_list} ${ID_PREFIX} ${time_to_finish} ${TRANSACTION_RATE_1K}
+ MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes ${restart_producer_node_ip_as_list} ${restart_producer_node_idx_as_list} ${ID_PREFIX} ${time_to_finish} ${TRANSACTION_RATE_1K} reset_globals=${False}
${resp_list} = MdsalLowlevelPy.Wait_For_Transactions
: FOR ${resp} IN @{resp_list}
\ TemplatedRequests.Check_Status_Code ${resp}