1 # Copyright 2015 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """ResultsConstants class
17 class ResultsConstants(object):
18 """Constant fields holder used by various IResult implementations.
22 PACKET_SIZE = 'packet_size'
23 DEPLOYMENT = 'deployment'
24 TRAFFIC_TYPE = 'traffic_type'
25 GUEST_LOOPBACK = 'guest_loopback_app'
26 TUNNEL_TYPE = 'tunnel_type'
28 UNKNOWN_VALUE = "Unknown"
31 #RFC2544 Throughput & Continuous
32 TX_RATE_FPS = 'tx_rate_fps'
33 THROUGHPUT_RX_FPS = 'throughput_rx_fps'
34 TX_RATE_MBPS = 'tx_rate_mbps'
35 THROUGHPUT_RX_MBPS = 'throughput_rx_mbps'
36 TX_RATE_PERCENT = 'tx_rate_percent'
37 THROUGHPUT_RX_PERCENT = 'throughput_rx_percent'
38 MIN_LATENCY_NS = 'min_latency_ns'
39 MAX_LATENCY_NS = 'max_latency_ns'
40 AVG_LATENCY_NS = 'avg_latency_ns'
41 FRAME_LOSS_PERCENT = 'frame_loss_percent'
43 TX_FRAMES = 'tx_frames'
44 RX_FRAMES = 'rx_frames'
47 PAYLOAD_ERR = 'payload_err'
50 B2B_RX_FPS = 'b2b_rx_fps'
51 B2B_TX_FPS = 'b2b_tx_fps'
52 B2B_RX_PERCENT = 'b2b_rx_percent'
53 B2B_TX_PERCENT = 'b2b_tx_percent'
54 B2B_TX_COUNT = 'b2b_tx_count'
55 B2B_FRAMES = 'b2b_frames'
56 B2B_FRAME_LOSS_FRAMES = 'b2b_frame_loss_frames'
57 B2B_FRAME_LOSS_PERCENT = 'b2b_frame_loss_percent'
58 SCAL_STREAM_COUNT = 'stream_count'
59 SCAL_STREAM_TYPE = 'match_type'
60 SCAL_PRE_INSTALLED_FLOWS = 'pre-installed_flows'
62 TEST_RUN_TIME = "test_execution_time"
65 def get_traffic_constants():
66 """Method returns all Constants used to store results.
68 These data can be used to generate final output.
70 :return: List of Strings which contains column names used as a result
71 This applies to any traffic(RFC2544 throughput or continuous flow)
74 return [ResultsConstants.TYPE,
76 ResultsConstants.PACKET_SIZE,
77 ResultsConstants.DEPLOYMENT,
78 ResultsConstants.TX_RATE_FPS,
79 ResultsConstants.THROUGHPUT_RX_FPS,
80 ResultsConstants.TX_RATE_MBPS,
81 ResultsConstants.THROUGHPUT_RX_MBPS,
82 ResultsConstants.TX_RATE_PERCENT,
83 ResultsConstants.THROUGHPUT_RX_PERCENT,
84 ResultsConstants.MIN_LATENCY_NS,
85 ResultsConstants.MAX_LATENCY_NS,
86 ResultsConstants.AVG_LATENCY_NS,
87 ResultsConstants.FRAME_LOSS_PERCENT]