1 # Copyright (c) 2023 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
16 | ... | Performance suite keywords - Displaying results as test messages.
17 | ... | This includes checks to fail test.
22 | | ... | Compute (bidir) bandwidth from given (unidir) transaction rate.
24 | | ... | This keyword reads \${ppta} and \${avg_aggregated_frame_size} set
25 | | ... | elsewhere. The implementation should work for both pps and cps rates.
27 | | ... | *Arguments:*
28 | | ... | - tps - Transaction rate (unidirectional) [tps]. Type: float
31 | | ... | - Computed bandwidth in Gbps.
32 | | ... | - Computed aggregated packet rate in pps.
36 | | ... | |\ \${bandwidth} \| \${pps} = \| Compute Bandwidth \| \${12345.67} \|
38 | | [Arguments] | ${tps}
40 | | ${ppta} = | Get Packets Per Transaction Aggregated
41 | | ${pps} = | Evaluate | ${tps} * ${ppta}
42 | | ${bandwidth} = | Evaluate | ${pps} * (${avg_aggregated_frame_size}+20)*8/1e9
43 | | Return From Keyword | ${bandwidth} | ${pps}
45 | Display Reconfig Test Message
47 | | ... | Display the number of packets lost (bidirectionally)
48 | | ... | due to reconfiguration under traffic.
50 | | ... | *Arguments:*
51 | | ... | - result - Result of MLRsearch invocation for one search goal.
52 | | ... | Type: StatInterval
56 | | ... | \| Display Reconfig Test Message \| \${result} \|
58 | | [Arguments] | ${result}
60 | | ${bandwidth} | ${packet_rate}= | Compute Bandwidth | ${result.intended_load}
61 | | ${packet_loss} = | Set Variable | ${result.loss_count}
62 | | ${time_loss} = | Evaluate | ${packet_loss} / ${packet_rate}
63 | | Set Test Message | Packets lost due to reconfig: ${packet_loss}
64 | | Set Test Message | ${\n}Implied time lost: ${time_loss} | append=yes
65 | | Export Reconf Result | ${packet_rate} | ${packet_loss} | ${bandwidth * 1e9}
67 | Display result of NDRPDR search
69 | | ... | Display result of NDR+PDR search, both quantities, aggregated,
70 | | ... | conditional throughput only, in units given by trasaction type,
71 | | ... | e.g. by default in packet per seconds and Gbps total bandwidth
72 | | ... | (for initial packet size).
73 | | ... | The lower bounds in the result are assumed to be valid.
75 | | ... | Througput is calculated as:
76 | | ... | Sum of measured rate over streams
77 | | ... | Bandwidth is calculated as:
78 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
79 | | ... | If the results contain latency data, display them for lower bounds.
81 | | ... | *Test (or broader scope) variables read:*
82 | | ... | - frame_size_num - L2 Frame Size [B]. Type: integer or float
83 | | ... | - transaction_type - String identifier to determine how to count
84 | | ... | transactions. Default is "packet".
85 | | ... | *Arguments:*
86 | | ... | - result - Measured result data Tps. Type: List[TrimmedStat]
87 | | ... | *Returns:* NDR and PDR: Unidirectional intended load as tps float.
91 | | ... | \| Display result of NDRPDR search \| \${result} \|
93 | | [Arguments] | ${result}
95 | | ${ndr} = | Convert To Number | ${result[0].relevant_lower_bound}
96 | | ${pdr} = | Convert To Number | ${result[1].relevant_lower_bound}
97 | | Display single bound | NDR | ${result[0].conditional_throughput}
98 | | Display single bound | PDR | ${result[1].conditional_throughput}
99 | | Return From Keyword | ${ndr} | ${pdr}
101 | Display result of soak search
103 | | ... | Display result of soak search, avg+-stdev, as upper/lower bounds.
104 | | ... | See Display single bound for units used.
105 | | ... | The displayed values are bidirectional, based on conditional
106 | | ... | throughput. The returned
108 | | ... | *Test (or broader scope) variables read:*
109 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or
111 | | ... | - transaction_type - String identifier to determine how to count
112 | | ... | transactions. Default is "packet".
113 | | ... | *Arguments:*
114 | | ... | - avg - Estimated average critical load [pps]. Type: float
115 | | ... | - stdev - Standard deviation of critical load [pps]. Type: float
117 | | ... | - Lower and upper bound of critical load [pps]. Type: 2-tuple of float
121 | | ... | \| Display result of soak search \| \${100000} \| \${100} \|
123 | | [Arguments] | ${avg} | ${stdev}
125 | | ${avg} = | Convert To Number | ${avg}
126 | | ${stdev} = | Convert To Number | ${stdev}
127 | | ${lower} = | Evaluate | ${avg} - ${stdev}
128 | | ${upper} = | Evaluate | ${avg} + ${stdev}
129 | | Display single bound | PLRsearch lower bound | ${lower}
130 | | Display single bound | PLRsearch upper bound | ${upper}
131 | | Return From Keyword | ${lower} | ${upper}
133 | Display single bound
135 | | ... | Compute and display one bound of NDR+PDR (or soak) search result.
137 | | ... | The bound to display is given as target transfer rate, it is assumed
138 | | ... | valid and in transactions per second. Bidirectional traffic
139 | | ... | transaction is understood as having 2 packets, for this purpose.
141 | | ... | Pps values are aggregated, in packet per seconds
142 | | ... | and Gbps total bandwidth (for initial packet size).
143 | | ... | If the latency string is present, it is displayed as well.
145 | | ... | Througput is calculated as:
146 | | ... | Sum of measured rate over streams
147 | | ... | Bandwidth is calculated as:
148 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
149 | | ... | If the results contain latency data, display them for lower bounds.
151 | | ... | *Test (or broader scope) variables read:*
152 | | ... | - transaction_type - String identifier to determine how to count
153 | | ... | transactions. Default is "packet".
154 | | ... | *Arguments:*
155 | | ... | - text - Flavor text describing which bound is this. Type: string
156 | | ... | - tps - Conditional throughput [tps]. Type: Union[float, DiscreteLoad]
157 | | ... | - latency - Latency data to display if non-empty. Type: string
161 | | ... | \| Display single bound \| NDR \| \${12345.67} \
162 | | ... | \| latency=\${EMPTY} \|
164 | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY}
166 | | ${tps} = | Convert To Number | ${tps}
167 | | ${transaction_type} = | Get Transaction Type
168 | | Run Keyword And Return If | """_cps""" in """${transaction_type}"""
169 | | ... | Display Single CPS Bound | ${text} | ${tps} | ${latency}
170 | | Run Keyword And Return
171 | | ... | Display Single PPS Bound | ${text} | ${tps} | ${latency}
173 | Display Single CPS Bound
175 | | ... | Display one bound of NDR+PDR search for CPS tests.
176 | | ... | The bounds are expressed as transactions per second.
177 | | ... | If the latency string is present, it is displayed as well.
179 | | ... | *Arguments:*
180 | | ... | - text - Flavor text describing which bound is this. Type: string
181 | | ... | - tps - Transaction rate [tps]. Type: float
182 | | ... | - latency - Latency data to display if non-empty. Type: string
186 | | ... | \| Display Single CPS Bound \| NDR lower bound \| \${12345.67} \
187 | | ... | \| latency=\${EMPTY} \|
189 | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY}
191 | | Set Test Message | ${\n}${text}: ${tps} CPS | append=yes
192 | | ${bandwidth} | ${pps} = | Compute Bandwidth | ${tps}
193 | | Export Search Bound | ${text} | ${tps} | cps | ${bandwidth * 1e9}
194 | | Run Keyword If | """${latency}""" | Set Test Message
195 | | ... | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency} | append=yes
197 | Display Single PPS Bound
199 | | ... | Display one pps bound of NDR+PDR search, aggregated,
200 | | ... | in packet per seconds and Gbps total bandwidth
201 | | ... | (for initial packet size).
203 | | ... | The bound to display is given as target transfer rate, it is assumed
204 | | ... | it is in transactions per second. Bidirectional traffic
205 | | ... | transaction is understood as having 2 packets, for this purpose.
207 | | ... | Througput is calculated as:
208 | | ... | Sum of measured rates over streams
209 | | ... | Bandwidth is calculated as:
210 | | ... | (Throughput * (L2 Frame Size + IPG) * 8)
211 | | ... | If the latency string is present, it is displayed as well.
213 | | ... | *Arguments:*
214 | | ... | - text - Flavor text describing which bound is this. Type: string
215 | | ... | - tps - Transaction rate [tps]. Type: float
216 | | ... | - latency - Latency data to display if non-empty. Type: string
220 | | ... | \| Display Single PPS Bound \| NDR lower bound \| \${12345.67} \
221 | | ... | \| latency=\${EMPTY} \|
223 | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY}
225 | | ${bandwidth} | ${pps} = | Compute Bandwidth | ${tps}
226 | | Set Test Message | ${\n}${text}: ${pps} pps, | append=yes
227 | | Set Test Message | ${bandwidth} Gbps (initial) | append=yes
228 | | Export Search Bound | ${text} | ${pps} | pps | ${bandwidth * 1e9}
229 | | Run Keyword If | """${latency}""" | Set Test Message
230 | | ... | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency} | append=yes