From ca3f7e0f81f782638440353c456382b6e607c71e Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Mon, 7 Mar 2016 10:55:59 +0200 Subject: changed rx stats to flow stats everywhere --- scripts/stl/flow_stats.py | 20 ++++++++++++++++++++ scripts/stl/rx_stats.py | 19 ------------------- scripts/stl/yaml/imix_1pkt_2.yaml | 8 ++++---- scripts/stl/yaml/imix_1pkt_vm.yaml | 2 +- scripts/stl/yaml/imix_1pkt_vm_minus.yaml | 2 +- 5 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 scripts/stl/flow_stats.py delete mode 100644 scripts/stl/rx_stats.py (limited to 'scripts/stl') diff --git a/scripts/stl/flow_stats.py b/scripts/stl/flow_stats.py new file mode 100644 index 00000000..9248c691 --- /dev/null +++ b/scripts/stl/flow_stats.py @@ -0,0 +1,20 @@ +from trex_stl_lib.api import * + +# stream from pcap file. continues pps 10 in sec + +class STLS1(object): + + def get_streams (self, direction = 0): + return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd +# mode = STLTXCont(pps=10), + mode = STLTXSingleBurst(pps=1000, total_pkts=100000), + flow_stats = STLRxStats(pg_id = 7)) + ] + + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + diff --git a/scripts/stl/rx_stats.py b/scripts/stl/rx_stats.py deleted file mode 100644 index 892fe1a0..00000000 --- a/scripts/stl/rx_stats.py +++ /dev/null @@ -1,19 +0,0 @@ -from trex_stl_lib.api import * - -# stream from pcap file. continues pps 10 in sec - -class STLS1(object): - - def get_streams (self, direction = 0): - return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd - mode = STLTXCont(pps=10), - rx_stats = STLRxStats(user_id = 7)) - ] - - -# dynamic load - used for trex console or simulator -def register(): - return STLS1() - - - diff --git a/scripts/stl/yaml/imix_1pkt_2.yaml b/scripts/stl/yaml/imix_1pkt_2.yaml index dc1a457b..014ffdbc 100644 --- a/scripts/stl/yaml/imix_1pkt_2.yaml +++ b/scripts/stl/yaml/imix_1pkt_2.yaml @@ -8,7 +8,7 @@ mode: type: continuous pps: 100 - rx_stats: [] + flow_stats: [] vm: [] - name: udp_64B_2 stream: @@ -18,7 +18,7 @@ mode: type: continuous pps: 100 - rx_stats: [] + flow_stats: [] vm: [] - name: udp_64B_3 stream: @@ -28,7 +28,7 @@ mode: type: continuous pps: 100 - rx_stats: [] + flow_stats: [] vm: [] - name: udp_64B_4 stream: @@ -38,5 +38,5 @@ mode: type: continuous pps: 100 - rx_stats: [] + flow_stats: [] vm: [] diff --git a/scripts/stl/yaml/imix_1pkt_vm.yaml b/scripts/stl/yaml/imix_1pkt_vm.yaml index 698d3e60..5d9da5af 100644 --- a/scripts/stl/yaml/imix_1pkt_vm.yaml +++ b/scripts/stl/yaml/imix_1pkt_vm.yaml @@ -8,7 +8,7 @@ mode: type: continuous pps: 100 - rx_stats: [] + flow_stats: [] vm: instructions: [ diff --git a/scripts/stl/yaml/imix_1pkt_vm_minus.yaml b/scripts/stl/yaml/imix_1pkt_vm_minus.yaml index bf67c83c..e83cfdd0 100644 --- a/scripts/stl/yaml/imix_1pkt_vm_minus.yaml +++ b/scripts/stl/yaml/imix_1pkt_vm_minus.yaml @@ -8,7 +8,7 @@ mode: type: continuous pps: 100 - rx_stats: [] + flow_stats: [] vm: instructions: [ -- cgit 1.2.3-korg From ea61eabf9f76ef4dea1ad2a4f0cd5cd8f367bd02 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Mon, 7 Mar 2016 11:21:21 +0200 Subject: changed STLRxStats to STLFlowStats --- .../automation/trex_control_plane/stl/examples/stl_flow_stats.py | 2 +- .../trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py | 8 ++++---- scripts/stl/flow_stats.py | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'scripts/stl') diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py b/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py index 6fb33b22..3708834e 100644 --- a/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py +++ b/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py @@ -18,7 +18,7 @@ def rx_example (tx_port, rx_port, burst_size): total_pkts = burst_size s1 = STLStream(name = 'rx', packet = pkt, - flow_stats = STLRxStats(pg_id = 5), + flow_stats = STLFlowStats(pg_id = 5), mode = STLTXSingleBurst(total_pkts = total_pkts, bps_L2 = 250000000)) # connect to server diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py index cc42c676..7fc132b1 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py @@ -124,7 +124,7 @@ STLStreamDstMAC_PKT =1 STLStreamDstMAC_ARP =2 # RX stats class -class STLRxStats(object): +class STLFlowStats(object): def __init__ (self, pg_id): self.fields = {} @@ -242,7 +242,7 @@ class STLStream(object): self.packet_desc = None if not flow_stats: - self.fields['flow_stats'] = STLRxStats.defaults() + self.fields['flow_stats'] = STLFlowStats.defaults() else: self.fields['flow_stats'] = flow_stats.to_json() @@ -392,7 +392,7 @@ class STLStream(object): if default_STLStream.fields['isg'] != self.fields['isg']: stream_params_list.append('isg = %s' % self.fields['isg']) if default_STLStream.fields['flow_stats'] != self.fields['flow_stats']: - stream_params_list.append('flow_stats = STLRxStats(%s)' % self.fields['flow_stats']['stream_id']) + stream_params_list.append('flow_stats = STLFlowStats(%s)' % self.fields['flow_stats']['stream_id']) if default_STLStream.next != self.next: stream_params_list.append('next = %s' % STLStream.__add_quotes(self.next)) if default_STLStream.id != self.id: @@ -523,7 +523,7 @@ class YAMLLoader(object): if pg_id == None: raise STLError("enabled RX stats section must contain 'stream_id' field") - return STLRxStats(pg_id = pg_id) + return STLFlowStats(pg_id = pg_id) def __parse_stream (self, yaml_object): diff --git a/scripts/stl/flow_stats.py b/scripts/stl/flow_stats.py index 9248c691..05d7a9f7 100644 --- a/scripts/stl/flow_stats.py +++ b/scripts/stl/flow_stats.py @@ -6,9 +6,8 @@ class STLS1(object): def get_streams (self, direction = 0): return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd -# mode = STLTXCont(pps=10), - mode = STLTXSingleBurst(pps=1000, total_pkts=100000), - flow_stats = STLRxStats(pg_id = 7)) + mode = STLTXCont(pps=10), + flow_stats = STLFlowStats(pg_id = 7)) ] -- cgit 1.2.3-korg