feat(astf): Support framesizes for ASTF
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
index 96b0e0e..c90fc74 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2022 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -13,6 +13,7 @@
 
 *** Settings ***
 | Library | Collections
+| Library | resources.libraries.python.model.ExportResult
 | Library | resources.libraries.python.topology.Topology
 | Library | resources.libraries.python.NodePath
 | Library | resources.libraries.python.InterfaceUtil
@@ -45,7 +46,7 @@
 | | ... | Display results as formatted test message.
 | | ... | Fail if computed lower bound is 110% of the minimal rate or less.
 | | ... | Input rates are unidirectional, in transaction per second.
-| | ... | Reported result may contain aggregate pps rates, depending on test.
+| | ... | Reported result may contain aggregated pps rates, depending on test.
 | | ... | Call \${resetter} (if defined) to reset DUT state before each trial.
 | |
 | | ... | *Test (or broader scope) variables read:*
 | | ... | Display findings as a formatted test message.
 | | ... | Fail if a resulting lower bound has too high loss ratio.
 | | ... | Input rates are unidirectional, in transaction per second.
-| | ... | Reported result may contain aggregate pps rates, depending on test.
+| | ... | Reported result may contain aggregated pps rates, depending on test.
 | | ... | Additional latency measurements are performed for smaller loads,
 | | ... | even if latency stream is disabled in search. Their results
 | | ... | are also displayed.
 | | ... | final_trial_duration=${30.0}
 | | ... | initial_trial_duration=${1.0}
 | | ... | number_of_intermediate_phases=${2}
-| | ... | timeout=${720.0}
+| | ... | timeout=${1200.0}
 | | ... | ppta=${ppta}
 | | ... | resetter=${resetter}
 | | ... | traffic_directions=${traffic_directions}
 | | ... | final_trial_duration=${10.0}
 | | ... | initial_trial_duration=${1.0}
 | | ... | number_of_intermediate_phases=${1}
-| | ... | timeout=${720}
+| | ... | timeout=${1200}
 | | ... | ppta=${ppta}
 | | ... | resetter=${resetter}
 | | ... | traffic_directions=${traffic_directions}
 | | ... | ramp_up_rate=${ramp_up_rate}
 | | ${latency} = | Get Latency Int
 | | Set Test Message | ${\n}${message_prefix} ${latency} | append=${True}
+| | Export Ndrpdr Latency | ${message_prefix} | ${latency}
 
 | Send ramp-up traffic
 | | [Documentation]
 | | ... | Type: boolean
 | | ... | - duration_limit - Hard limit for trial duration, overriding duration
 | | ... | computed from transaction_scale. Default 0.0 means no limit.
+| | ... | - export_mrr_unit - Use this unit when exporting MRR values,
+| | ... | or empty string for no export.
 | |
 | | ... | *Example:*
 | |
 | | ... | \| Send traffic at specified rate \| \${1.0} \| ${4000000.0} \
-| | ... | \| \${10} \| ${False} \| ${1.0} \|
+| | ... | \| \${10} \| ${False} \| ${1.0} \| pps \|
 | |
 | | [Arguments] | ${trial_duration} | ${rate} | ${trial_multiplicity}
 | | ... | ${use_latency}=${False} | ${duration_limit}=${0.0}
+| | ... | ${export_mrr_unit}=${Empty}
 | |
 | | ${ppta} = | Get Packets Per Transaction Aggregated
 | | ${ramp_up_duration} = | Get Ramp Up Duration
 | | ${transaction_scale} = | Get Transaction Scale
 | | ${transaction_type} = | Get Transaction Type
 | | Set Test Variable | \${rate_for_teardown} | ${rate}
+| | Set Test Variable | \${runtime_rate} | ${rate}
 | | FOR | ${action} | IN | @{stat_runtime}
 | | | Run Keyword | Additional Statistics Action For ${action}
 | | END
 | | | ... | ramp_up_rate=${ramp_up_rate}
 | | | # Out of several quantities for aborted traffic (duration stretching),
 | | | # the approximated receive rate is the best estimate we have.
-| | | Append To List | ${results} | ${result.approximated_receive_rate}
+| | | ${value} = | Set Variable | ${result.approximated_receive_rate}
+| | | # TODO: Add correct bandwidth computation.
+| | | Append Mrr Value | ${value} | ${export_mrr_unit}
+| | | Append To List | ${results} | ${value}
 | | END
 | | FOR | ${action} | IN | @{stat_post_trial}
 | | | Run Keyword | Additional Statistics Action For ${action}
 | | ... | *Arguments:*
 | | ... | - trial_duration - Duration of single trial [s].
 | | ... | Type: float
-| | ... | - rate - Target aggregate transmit rate [bps] / Bits per second
+| | ... | - rate - Target aggregated transmit rate [bps] / Bits per second.
 | | ... | Type: float
 | | ... | - frame_size - L2 Frame Size [B].
 | | ... | Type: integer or string
 | | ${smt_used}= | Is SMT enabled | ${nodes['${iperf_server_node}']['cpuinfo']}
 | | ${vm_status} | ${value}= | Run Keyword And Ignore Error
 | | ... | Get Library Instance | vnf_manager
-| | ${vth}= | Evaluate | (${thr_count_int} + 1)
+| | ${vth}= | Evaluate | (${dp_count_int} + 1)
 | | ${cpu_skip_cnt}= | Set Variable If | '${vm_status}' == 'PASS'
 | | ... | ${CPU_CNT_SYSTEM}
 | | ... | ${${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${cpu_count_int} + ${vth}}
 | | ... | bind_mask=${iperf_server_bind_mask}
 | | ... | namespace=${iperf_server_namespace}
 | | ... | cpu_skip_cnt=${cpu_skip_cnt}
-| | Run Keyword If | '${iperf_client_namespace}' is not '${None}'
+| | Run Keyword If | '${iperf_client_namespace}' != '${None}'
 | | ... | Set Linux Interface IP
 | | ... | ${nodes['${iperf_client_node}']}
 | | ... | interface=${iperf_client_interface}
 | | ... | ip_addr=${iperf_client_bind}
 | | ... | prefix=${iperf_client_bind_mask}
 | | ... | namespace=${iperf_client_namespace}
-| | Run Keyword If | '${iperf_client_namespace}' is not '${None}'
+| | Run Keyword If | '${iperf_client_namespace}' != '${None}'
 | | ... | Add Default Route To Namespace
 | | ... | ${nodes['${iperf_client_node}']}
 | | ... | namespace=${iperf_client_namespace}
 | | ${trial_duration} = | Get Mrr Trial Duration
 | | ${trial_multiplicity} = | Get Mrr Trial Multiplicity
 | | ${use_latency} = | Get Use Latency
+| | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}"""
+| | ... | cps | pps
 | | # The following also sets \${rate_for_teardown}
 | | ${results} = | Send traffic at specified rate
 | | ... | rate=${max_rate}
 | | ... | trial_multiplicity=${trial_multiplicity}
 | | ... | use_latency=${use_latency}
 | | ... | duration_limit=${0.0}
-| | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}"""
+| | ... | export_mrr_unit=${unit}
+| | ${unit_text} = | Set Variable If | """_cps""" in """${transaction_type}"""
 | | ... | estimated connections per second | packets per second
 | | Set Test Message | ${\n}Maximum Receive Rate trial results
-| | Set Test Message | in ${unit}: ${results}
+| | Set Test Message | in ${unit_text}: ${results}
 | | ... | append=yes
 | | Fail if no traffic forwarded