Цветков Андрей
unread,May 7, 2024, 11:29:03 AMMay 7Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TRex Traffic Generator
for name in self.params['profiles'].keys():
self.trex_client.start(mult=1, duration=-1, pid_input=name)
while True:
state = self.trex_client.get_profiles_state()
state.pop("_")
list_state = list(set(state.values()))
if len(list_state) == 1 and list_state[0] == 'STATE_TX':
break
else:
logging.debug(f"Profiles state : {state}")
sleep(0.1)
while True:
name = list(state)[0]
logging.debug(f"State : {name}")
temp = self.trex_client.get_stats(skip_zero=False, pid_input=name)
# if temp["traffic"]["server"]["m_traffic_duration"] > 2:
# break
# else:
state_profile = self.trex_client.get_profiles_state()
logging.debug(f"Profiles state : {state_profile}")
logging.debug(f'trex time - {temp["traffic"]["server"]["m_traffic_duration"]} - {temp["traffic"]["client"]["m_traffic_duration"]}')
sleep(1)
I load two profiles, default profile is empty and I don’t launch it. The code gives me:
18:20:18 DEBUG State : emix
18:20:18 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:18 DEBUG trex time - 0.40800463198124287 - 0.40816087035650017
18:20:19 DEBUG State : emix
18:20:19 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:19 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:20 DEBUG State : emix
18:20:20 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:20 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:21 DEBUG State : emix
18:20:21 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:21 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:22 DEBUG State : emix
18:20:22 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:22 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:23 DEBUG State : emix
18:20:23 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:23 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:24 DEBUG State : emix
18:20:24 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:24 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:25 DEBUG State : emix
18:20:25 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:25 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:26 DEBUG State : emix
18:20:26 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:26 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:27 DEBUG State : emix
18:20:27 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:27 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:28 DEBUG State : emix
18:20:28 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:28 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:29 DEBUG State : emix
18:20:29 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:29 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:30 DEBUG State : emix
18:20:30 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:30 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:31 DEBUG State : emix
18:20:31 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:31 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:32 DEBUG State : emix
18:20:32 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:32 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:33 DEBUG State : emix
18:20:33 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:33 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:34 DEBUG State : emix
18:20:34 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:34 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:35 DEBUG State : emix
18:20:35 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:35 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:36 DEBUG State : emix
18:20:36 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:36 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:37 DEBUG State : emix
18:20:37 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:37 DEBUG trex time - 1.0620995466633782 - 0.6046398472450256
18:20:38 DEBUG State : emix
18:20:38 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:38 DEBUG trex time - 20.42548048500393 - 20.483776306479974
18:20:39 DEBUG State : emix
18:20:39 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:39 DEBUG trex time - 20.83447248558345 - 20.604861304804448
18:20:40 DEBUG State : emix
18:20:40 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:40 DEBUG trex time - 20.83447248558345 - 20.604861304804448
18:20:41 DEBUG State : emix
18:20:41 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:41 DEBUG trex time - 20.83447248558345 - 20.604861304804448
18:20:42 DEBUG State : emix
18:20:42 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:42 DEBUG trex time - 20.83447248558345 - 20.604861304804448
18:20:43 DEBUG State : emix
18:20:43 DEBUG Profiles state : {'_': 'STATE_IDLE', 'emix': 'STATE_TX', 'cps': 'STATE_TX'}
18:20:43 DEBUG trex time - 20.83447248558345 - 20.604861304804448
Config
[{"port_limit": 2, "version": 2, "interfaces": ["0000:3b:00.1", "0000:3b:00.0"], "low_end": false, "enable_zmq_pub": true, "prefix": 1, "zmq_pub_port": 4500, "zmq_rpc_port": 4501
, "trex_zmq_port": 4500, "stack": "linux_based", "c": 20, "platform": {"master_thread_id": 0, "latency_thread_id": 21, "dual_if": [{"socket": 0, "threads": [1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]}]}}]
network i810 . If i set 10 cpu freeze decrease to 10 sec. No other metrics do not update on request too.