style(robot): capitalize two keywords properly
[csit.git] / resources / libraries / robot / performance / performance_display.robot
index c34fdda..aaf5be8 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:
@@ -36,7 +36,7 @@
 | | ${lower_bound} = | Set Variable | ${interval.measured_low}
 | | ${lower_bound_lr} = | Set Variable | ${lower_bound.loss_ratio}
 | | Return From Keyword If | ${lower_bound_lr} <= ${packet_loss_ratio}
-| | Set Test Variable | \${rate_for_teardown} | ${lower_bound_lr}
+| | Set Test Variable | \${rate_for_teardown} | ${lower_bound.target_tr}
 | | ${message}= | Catenate | SEPARATOR=${SPACE}
 | | ... | Minimal rate loss ratio ${lower_bound_lr}
 | | ... | does not reach target ${packet_loss_ratio}.
 | | ... | ${message}${\n}${message_zero} | ${message}${\n}${message_other}
 | | Fail | ${message}
 
+| Compute Bandwidth
+| | [Documentation]
+| | ... | Compute (bidir) bandwidth from given (unidir) transaction rate.
+| | ...
+| | ... | This keyword reads \${ppta} and \${avg_aggregated_frame_size} set
+| | ... | elsewhere. The implementation should work for both pps and cps rates.
+| | ... |
+| | ... | *Arguments:*
+| | ... | - tps - Transaction rate (unidirectional) [tps]. Type: float
+| | ...
+| | ... | *Returns:*
+| | ... | - Computed bandwidth in Gbps.
+| | ... | - Computed aggregated packet rate in pps.
+| |
+| | ... | *Example:*
+| |
+| | ... | |\ \${bandwidth} \| \${pps} = \| Compute Bandwidth \| \${12345.67} \|
+| |
+| | [Arguments] | ${tps}
+| |
+| | ${ppta} = | Get Packets Per Transaction Aggregated
+| | ${pps} = | Evaluate | ${tps} * ${ppta}
+| | ${bandwidth} = | Evaluate | ${pps} * (${avg_aggregated_frame_size}+20)*8/1e9
+| | Return From Keyword | ${bandwidth} | ${pps}
+
 | Display Reconfig Test Message
 | | [Documentation]
 | | ... | Display the number of packets lost (bidirectionally)
@@ -71,7 +96,7 @@
 | Display result of NDRPDR search
 | | [Documentation]
 | | ... | Display result of NDR+PDR search, both quantities, both bounds,
-| | ... | aggregate in units given by trasaction type, e.g. by default
+| | ... | aggregated, in units given by trasaction type, e.g. by default
 | | ... | in packet per seconds and Gbps total bandwidth
 | | ... | (for initial packet size).
 | | ... |
 | | ... | - transaction_type - String identifier to determine how to count
 | | ... | transactions. Default is "packet".
 | | ... | *Arguments:*
-| | ... | - result - Measured result data. Aggregate rate, tps or pps.
+| | ... | - result - Measured result data. Aggregated rate, tps or pps.
 | | ... | Type: NdrPdrResult
 | |
 | | ... | *Example:*
 | | ... | it is in transactions per second. Bidirectional traffic
 | | ... | transaction is understood as having 2 packets, for this purpose.
 | | ... |
-| | ... | Pps values are aggregate in packet per seconds,
+| | ... | Pps values are aggregated, in packet per seconds
 | | ... | and Gbps total bandwidth (for initial packet size).
 | | ... |
 | | ... | Througput is calculated as:
 | |
 | | ${transaction_type} = | Get Transaction Type
 | | Run Keyword And Return If | """_cps""" in """${transaction_type}"""
-| | ... | Display single cps bound | ${text} | ${tps} | ${latency}
-| | Display single pps bound | ${text} | ${tps} | ${latency}
+| | ... | Display Single CPS Bound | ${text} | ${tps} | ${latency}
+| | Display Single PPS Bound | ${text} | ${tps} | ${latency}
 
-| Display single cps bound
+| Display Single CPS Bound
 | | [Documentation]
 | | ... | Display one bound of NDR+PDR search for CPS tests.
 | | ... | The bounds are expressed as transactions per second.
 | |
 | | ... | *Example:*
 | |
-| | ... | \| Display single cps bound \| NDR lower bound \| \${12345.67} \
+| | ... | \| Display Single CPS Bound \| NDR lower bound \| \${12345.67} \
 | | ... | \| latency=\${EMPTY} \|
 | |
 | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY}
 | |
 | | Set Test Message | ${\n}${text}: ${tps} CPS | append=yes
+| | ${bandwidth} | ${pps} = | Compute Bandwidth | ${tps}
+| | Export Search Bound | ${text} | ${tps} | cps | ${bandwidth}
 | | Return From Keyword If | not """${latency}"""
 | | Set Test Message | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency}
 | | ... | append=yes
 
-| Display single pps bound
+| Display Single PPS Bound
 | | [Documentation]
-| | ... | Display one pps bound of NDR+PDR search,
-| | ... | aggregate in packet per seconds and Gbps total bandwidth
+| | ... | Display one pps bound of NDR+PDR search, aggregated,
+| | ... | in packet per seconds and Gbps total bandwidth
 | | ... | (for initial packet size).
 | | ... |
 | | ... | The bound to display is given as target transfer rate, it is assumed
 | |
 | | ... | *Example:*
 | |
-| | ... | \| Display single pps bound \| NDR lower bound \| \${12345.67} \
+| | ... | \| Display Single PPS Bound \| NDR lower bound \| \${12345.67} \
 | | ... | \| latency=\${EMPTY} \|
 | |
 | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY}
 | |
-| | ${ppta} = | Get Packets Per Transaction Aggregated
-| | ${pps} = | Evaluate | ${tps} * ${ppta}
-| | ${bandwidth} = | Evaluate | ${pps} * (${avg_frame_size}+20)*8 / 1e9
+| | ${bandwidth} | ${pps} = | Compute Bandwidth | ${tps}
 | | Set Test Message | ${\n}${text}: ${pps} pps, | append=yes
 | | Set Test Message | ${bandwidth} Gbps (initial) | append=yes
+| | Export Search Bound | ${text} | ${pps} | pps | ${bandwidth * 1e9}
 | | Return From Keyword If | not """${latency}"""
 | | Set Test Message | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency}
 | | ... | append=yes