Improve pf layer
[csit.git] / resources / libraries / robot / wrk / wrk_utils.robot
1 # Copyright (c) 2020 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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14 *** Settings ***
15 | Library | resources.tools.wrk.wrk
16 | Library | resources.libraries.python.IPUtil
17 | Library | resources.libraries.python.DUTSetup
18 | Library | resources.libraries.python.TrafficGenerator
19 | Library | resources.libraries.python.topology.Topology
20 |
21 | Documentation | L2 keywords to set up wrk and to measure performance
22 | ... | parameters using wrk.
23
24 *** Variables ***
25 | ${wrk_ip_prefix}= | 24
26 | @{wrk_ip_addrs}= | 192.168.10.1 | 192.168.20.1 | 192.168.30.1
27 | ... | 192.168.40.1 | 192.168.50.1 | 192.168.60.1 | 192.168.70.1
28 | ... | 192.168.80.1
29
30 *** Keywords ***
31 | Measure throughput
32 | | [Documentation]
33 | | ... | Measure throughput using wrk.
34 | |
35 | | ... | *Arguments:*
36 | | ... | - ${profile} - The name of the wrk traffic profile defining the
37 | | ... | traffic. Type: string
38 | |
39 | | ... | *Example:*
40 | |
41 | | ... | \| Measure throughput \| wrk-bw-1url-1core-50con \|
42 | |
43 | | [Arguments] | ${profile}
44 | |
45 | | ${tg_numa}= | Get interfaces numa node | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0]
46 | | ${output}= | Run wrk | ${tg} | ${profile} | ${tg_numa} | bw
47 | | Set test message | ${output}
48
49 | Measure requests per second
50 | | [Documentation]
51 | | ... | Measure number of requests per second using wrk.
52 | |
53 | | ... | *Arguments:*
54 | | ... | - ${profile} - The name of the wrk traffic profile defining the
55 | | ... | traffic. Type: string
56 | |
57 | | ... | *Example:*
58 | |
59 | | ... | \| Measure requests per second \| wrk-bw-1url-1core-50con \|
60 | |
61 | | [Arguments] | ${profile}
62 | |
63 | | ${tg_numa}= | Get interfaces numa node | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0]
64 | | ${output}= | Run wrk | ${tg} | ${profile} | ${tg_numa} | rps
65 | | Set test message | ${output}
66
67 | Measure connections per second
68 | | [Documentation]
69 | | ... | Measure number of connections per second using wrk.
70 | |
71 | | ... | *Arguments:*
72 | | ... | - ${profile} - The name of the wrk traffic profile defining the
73 | | ... | traffic. Type: string
74 | |
75 | | ... | *Example:*
76 | |
77 | | ... | \| Measure connections per second \| wrk-bw-1url-1core-50con \|
78 | |
79 | | [Arguments] | ${profile}
80 | |
81 | | ${tg_numa}= | Get interfaces numa node | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0]
82 | | ${output}= | Run wrk | ${tg} | ${profile} | ${tg_numa} | cps
83 | | Set test message | ${output}