Is there a way how to get statistics from ASTF

512 views
Skip to first unread message

Petr Olejník

unread,
Sep 16, 2021, 9:06:32 AM9/16/21
to TRex Traffic Generator

Hello,

ASTF is great but we would need to see the statistics provided by trex console in time since they change a lot and also they fall back to zero after the end of the test.

We would like to run a test for an hour for example and see how the statistics changes in time. A simple CSV would be ok.

The Stateless GUI looks like exactly what I need. But it is only for stateless, not for ASTF.

Regards
Petr

Besart Dollma

unread,
Sep 18, 2021, 2:48:42 AM9/18/21
to TRex Traffic Generator
Hi Petr, 
There isn't anything like the Stateless GUI for ASTF, but we provide the full API in Python. This means, that you can collect statistics using a simple Python script and store them in any format you want.

Note that you need to modify this example to get statistics not only after the traffic has finished.
Thanks, 
Bes

Petr Olejník

unread,
Sep 20, 2021, 2:41:11 AM9/20/21
to TRex Traffic Generator
Hello Bes,

thank you very much for your answer. Sorry for maybe a dumb question but how should I run the example script? If I run

python astf_example.py

I get:
Traceback (most recent call last):
  File "astf_example.py", line 3, in <module>
    import astf_path
ImportError: No module named astf_path



Thanks in advance for helping a newbie.

BR
Petr
Dne sobota 18. září 2021 v 8:48:42 UTC+2 uživatel besi7...@gmail.com napsal:

Besart Dollma

unread,
Sep 24, 2021, 2:14:30 AM9/24/21
to TRex Traffic Generator
Hi Petr, 
Might it be that you are not running it from the correct directory?
It seems to me that it works as expected:

$ pwd
/auto/srg-sce-swinfra-usr/emb/users/bdollma/trex/trex-core/scripts/automation/trex_control_plane/interactive/trex/examples/astf
$ python3
Python 3.4.3 (default, Mar 23 2016, 14:21:41)
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import astf_path
>>>

Thanks, 

Petr Olejník

unread,
Sep 24, 2021, 2:47:55 AM9/24/21
to TRex Traffic Generator
Thank you, that was it :-)

Petr

Dne pátek 24. září 2021 v 8:14:30 UTC+2 uživatel besi7...@gmail.com napsal:
Reply all
Reply to author
Forward
0 new messages