VAT-to-PAPI: Fix HTTP/TCP tests
[csit.git] / resources / libraries / robot / wrk / wrk_utils.robot
1 # Copyright (c) 2019 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 *** Keywords ***
25 | Measure throughput
26 | | [Documentation]
27 | | ... | Measure throughput using wrk.
28 | | ...
29 | | ... | *Arguments:*
30 | | ... | - ${profile} - The name of the wrk traffic profile defining the
31 | | ... | traffic. Type: string
32 | | ...
33 | | ... | *Example:*
34 | | ...
35 | | ... | \| Measure throughput \| wrk-bw-1url-1core-50con \|
36 | | ...
37 | | [Arguments] | ${profile}
38 | | ...
39 | | ${tg_numa}= | Get interfaces numa node | ${tg} | ${tg_if1} | ${tg_if2}
40 | | ${output}= | Run wrk | ${tg} | ${profile} | ${tg_numa} | bw
41 | | Set test message | ${output}
42
43 | Measure requests per second
44 | | [Documentation]
45 | | ... | Measure number of requests per second using wrk.
46 | | ...
47 | | ... | *Arguments:*
48 | | ... | - ${profile} - The name of the wrk traffic profile defining the
49 | | ... | traffic. Type: string
50 | | ...
51 | | ... | *Example:*
52 | | ...
53 | | ... | \| Measure requests per second \| wrk-bw-1url-1core-50con \|
54 | | ...
55 | | [Arguments] | ${profile}
56 | | ...
57 | | ${tg_numa}= | Get interfaces numa node | ${tg} | ${tg_if1} | ${tg_if2}
58 | | ${output}= | Run wrk | ${tg} | ${profile} | ${tg_numa} | rps
59 | | Set test message | ${output}
60
61 | Measure connections per second
62 | | [Documentation]
63 | | ... | Measure number of connections per second using wrk.
64 | | ...
65 | | ... | *Arguments:*
66 | | ... | - ${profile} - The name of the wrk traffic profile defining the
67 | | ... | traffic. Type: string
68 | | ...
69 | | ... | *Example:*
70 | | ...
71 | | ... | \| Measure connections per second \| wrk-bw-1url-1core-50con \|
72 | | ...
73 | | [Arguments] | ${profile}
74 | | ...
75 | | ${tg_numa}= | Get interfaces numa node | ${tg} | ${tg_if1} | ${tg_if2}
76 | | ${output}= | Run wrk | ${tg} | ${profile} | ${tg_numa} | cps
77 | | Set test message | ${output}