Model: Add bandwidth to mrr
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
index fe14215..78a1fcc 100644 (file)
 | | | # Out of several quantities for aborted traffic (duration stretching),
 | | | # the approximated receive rate is the best estimate we have.
 | | | ${value} = | Set Variable | ${result.approximated_receive_rate}
-| | | # TODO: Add correct bandwidth computation.
-| | | Append Mrr Value | ${value} | ${export_mrr_unit}
+| | | ${bandwidth} | ${pps} = | Compute Bandwidth | ${value} / ${ppta}
+| | | Append Mrr Value | ${value} | ${export_mrr_unit} | ${bandwidth * 1e9}
 | | | Append To List | ${results} | ${value}
 | | END
 | | FOR | ${action} | IN | @{stat_post_trial}
 | | ${results}= | Send iPerf3 traffic at specified rate
 | | ... | ${trial_duration} | ${None} | ${None}
 | | ... | ${trial_multiplicity} | ${traffic_directions}
+| | ... | export_mrr_unit=bps
 | | Set Test Message | ${\n}iPerf3 trial results
 | | Set Test Message | in Gbits per second: ${results}
 | | ... | append=yes
 | | ... | Type: integer
 | | ... | - extended_debug - True to enable extended debug.
 | | ... | Type: boolean
+| | ... | - export_mrr_unit - Use this unit when exporting MRR values,
+| | ... | or empty string for no export.
+| | ... | Type: string
 | |
 | | ... | *Example:*
 | |
 | | [Arguments] | ${trial_duration} | ${rate} | ${frame_size}
 | | ... | ${trial_multiplicity}=${trial_multiplicity}
 | | ... | ${traffic_directions}=${1} | ${extended_debug}=${extended_debug}
+| | ... | ${export_mrr_unit}=${Empty}
 | |
 | | Set Test Variable | ${extended_debug}
 | | Set Test Variable | ${rate}
 | | | ... | bind=${iperf_client_bind}
 | | | ... | affinity=${iperf_client_affinity}
 | | | ${conv} = | Convert To Number | ${rr['sum_received']['bits_per_second']}
+| | | Append Mrr Value | ${conv} | ${export_mrr_unit}
 | | | ${conv} = | Evaluate | ${conv} / ${1000} / ${1000} / ${1000}
 | | | ${conv} = | Evaluate | "{:.3f}".format(${conv})
 | | | Append To List
 | | ... | \| Traffic should pass with maximum rate \|
 | |
 | | Set Test Variable | ${telemetry_rate} | mrr
-| | Set Test Variable | ${telemetry_export} | ${False}
+| | Set Test Variable | ${telemetry_export} | ${True}
 | | ${max_rate} = | Get Max Rate
 | | ${transaction_type} = | Get Transaction Type
 | | ${trial_duration} = | Get Mrr Trial Duration