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'
25 TRAFFIC_TYPE = 'traffic_type'
26 GUEST_LOOPBACK = 'guest_loopback_app'
27 TUNNEL_TYPE = 'tunnel_type'
29 UNKNOWN_VALUE = "Unknown"
32 #RFC2544 Throughput & Continuous
33 TX_RATE_FPS = 'tx_rate_fps'
34 THROUGHPUT_RX_FPS = 'throughput_rx_fps'
35 TX_RATE_MBPS = 'tx_rate_mbps'
36 THROUGHPUT_RX_MBPS = 'throughput_rx_mbps'
37 TX_RATE_PERCENT = 'tx_rate_percent'
38 THROUGHPUT_RX_PERCENT = 'throughput_rx_percent'
39 MIN_LATENCY_NS = 'min_latency_ns'
40 MAX_LATENCY_NS = 'max_latency_ns'
41 AVG_LATENCY_NS = 'avg_latency_ns'
42 FRAME_LOSS_PERCENT = 'frame_loss_percent'
44 TX_FRAMES = 'tx_frames'
45 RX_FRAMES = 'rx_frames'
48 PAYLOAD_ERR = 'payload_err'
51 B2B_RX_FPS = 'b2b_rx_fps'
52 B2B_TX_FPS = 'b2b_tx_fps'
53 B2B_RX_PERCENT = 'b2b_rx_percent'
54 B2B_TX_PERCENT = 'b2b_tx_percent'
55 B2B_TX_COUNT = 'b2b_tx_count'
56 B2B_FRAMES = 'b2b_frames'
57 B2B_FRAME_LOSS_FRAMES = 'b2b_frame_loss_frames'
58 B2B_FRAME_LOSS_PERCENT = 'b2b_frame_loss_percent'
59 SCAL_STREAM_COUNT = 'stream_count'
60 SCAL_STREAM_TYPE = 'match_type'
61 SCAL_PRE_INSTALLED_FLOWS = 'pre-installed_flows'
62 # RFC2889 Forwarding, Address-Caching and Address-Learning
63 FORWARDING_RATE_FPS = 'forwarding_rate_fps'
64 CACHING_CAPACITY_ADDRS = 'caching_capacity_addrs'
65 ADDR_LEARNED_PERCENT = 'addr_learned_percent'
66 OPTIMAL_LEARNING_RATE_FPS = 'optimal_learning_rate_fps'
68 TEST_RUN_TIME = "test_execution_time"
69 TEST_START_TIME = "start_time"
70 TEST_STOP_TIME = "stop_time"
72 # files with traffic capture
73 CAPTURE_TX = "capture_tx"
74 CAPTURE_RX = "capture_rx"
77 IMIX_GENOME = "imix_genome"
78 # IMIX Avg. Frame Size
79 IMIX_AVG_FRAMESIZE = "imix_avg_framesize"
82 def get_traffic_constants():
83 """Method returns all Constants used to store results.
85 These data can be used to generate final output.
87 :return: List of Strings which contains column names used as a result
88 This applies to any traffic(RFC2544 throughput or continuous flow)
91 return [ResultsConstants.TYPE,
93 ResultsConstants.PACKET_SIZE,
94 ResultsConstants.DEPLOYMENT,
95 ResultsConstants.TX_RATE_FPS,
96 ResultsConstants.THROUGHPUT_RX_FPS,
97 ResultsConstants.TX_RATE_MBPS,
98 ResultsConstants.THROUGHPUT_RX_MBPS,
99 ResultsConstants.TX_RATE_PERCENT,
100 ResultsConstants.THROUGHPUT_RX_PERCENT,
101 ResultsConstants.MIN_LATENCY_NS,
102 ResultsConstants.MAX_LATENCY_NS,
103 ResultsConstants.AVG_LATENCY_NS,
104 ResultsConstants.FRAME_LOSS_PERCENT,
105 ResultsConstants.IMIX_GENOME,
106 ResultsConstants.IMIX_AVG_FRAMESIZE]