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