Giter Site home page Giter Site logo

Comments (5)

therkong avatar therkong commented on August 10, 2024

Hi, traffic must be stopped when you do Traffic Generate.
If you want to modified the tx rate while the traffic is flowing, you should modify HighLevelStream (flowGroup) instead of ConfigElement.
When you update the Rate in HighLevelStream, there's no need to regenerate the traffic, the new rate will take effect immediately. code below:
flowGroups = traffic_item.HighLevelStream.find()
flowGroups.FrameRate.update(Type='bitsPerSecond', Rate=initial_rate)

from ixnetwork_restpy.

sngx13 avatar sngx13 commented on August 10, 2024

Hi,
Thank you for your reply, this has done the trick, is there better documentation where I could of find this out? I couldn't seem to find anything like this in the samples. Also is there an alternative way of getting packet loss information (close to real time) other than calling:

 session.StatViewAssistant(
        'Traffic Item Statistics'
    )

Kind regards.

from ixnetwork_restpy.

therkong avatar therkong commented on August 10, 2024

Glad that my suggestion worked!
As far as documentation, RestPy API Reference guide (https://openixia.github.io/ixnetwork_restpy/#/reference) under the TrafficItem/ConfigElement and HighLevelStreams mentions about the relationship between these two objects, but it is not clear unless you are familiar with ixNet GUI's relationship between TrafficItem Wizard and the Flow Groups that get created when you hit 'Generate' option for the Traffic Item. From GUI, you can update the rate, then start/stop a Flow Group. However, if you modify the rate from Traffic Item wizard, you must do 'Generate' again and 'Generate' requires the traffic to be in 'stopped' state.

To get packet loss information, the code you're using is correct. Can you tell me a bit more on your test scenario? Why do you need the 'packet loss' count in real time? What is the limitation of polling the stats with your current code?

from ixnetwork_restpy.

sngx13 avatar sngx13 commented on August 10, 2024

Hi,
Well it's not so much real time, we are trying to distinguish 0% los for a particular DUT type so we'd want to run a test and determine a "golden" value for a particular device. As long as counters returned within the 'while' loop are correct we should be fine right?
Also one thing i've forgot to ask, is there a way of clearing statistics between test runs ("Clear All Statistics" in the GUI)?
Thank you.

from ixnetwork_restpy.

therkong avatar therkong commented on August 10, 2024

you can simply call session.StatViewAssistant('Traffic Item Statistics'). Below is example code snip on getting Loss % and few other counters:
trafficItemStatistics = session.StatViewAssistant('Traffic Item Statistics')
for rowNumber,trafItemStat in enumerate(trafficItemStatistics.Rows):
ixNetwork.info('\n\nSTATS: {}\n\n'.format(trafItemStat))
ixNetwork.info('\nRow:{} TxFrames:{} RxFrames:{} Frames Delta:{} Loss %:{}\n'.format(
rowNumber, trafItemStat['Tx Frames'], trafItemStat['Rx Frames'], trafItemStat['Frames Delta'], trafItemStat['Loss %']))

I am not sure why you have 'while' loop/

Clear stats doc below:
clearStats(Arg1=list, async_operation=bool)

  • Arg1 (list(str[waitForPortStatsRefresh | waitForTrafficStatsRefresh])):
  • async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.

Example call:
ixNetwork.ClearStats() ==> returns right away
or
ixNetwork.ClearStats(['waitForTrafficStatsRefresh']) to wait for Traffic Item Statistics View to refresh

from ixnetwork_restpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.