docs: Remove trailing whitespaces
[vswitchperf.git] / core / results / results_constants.py
1 # Copyright 2015 Intel Corporation.
2 #
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
6 #
7 #   http://www.apache.org/licenses/LICENSE-2.0
8 #
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
15 """
16
17 class ResultsConstants(object):
18     """Constant fields holder used by various IResult implementations.
19     """
20     TYPE = 'type'
21     ID = 'id'
22     PACKET_SIZE = 'packet_size'
23     DEPLOYMENT = 'deployment'
24     TRAFFIC_TYPE = 'traffic_type'
25     GUEST_LOOPBACK = 'guest_loopback_app'
26     TUNNEL_TYPE = 'tunnel_type'
27
28     UNKNOWN_VALUE = "Unknown"
29
30     #Traffic Constants
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'
42     #Burst traffic
43     TX_FRAMES = 'tx_frames'
44     RX_FRAMES = 'rx_frames'
45     TX_BYTES = 'tx_bytes'
46     RX_BYTES = 'rx_bytes'
47     PAYLOAD_ERR = 'payload_err'
48     SEQ_ERR = 'seq_err'
49     #Back2Back
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'
61
62     TEST_RUN_TIME = "test_execution_time"
63
64     @staticmethod
65     def get_traffic_constants():
66         """Method returns all Constants used to store results.
67
68         These data can be used to generate final output.
69
70         :return: List of Strings which contains column names used as a result
71         This applies to any traffic(RFC2544 throughput or continuous flow)
72         operation.
73         """
74         return [ResultsConstants.TYPE,
75                 ResultsConstants.ID,
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]