Comments (5)
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.
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.
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.
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.
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)
- UnboundLocalError: local variable 'response' referenced before assignment HOT 4
- modification of attributes after commit not working for multivalue in Config Assistant
- .find() method is slow HOT 1
- Trying to start traffic loading a file HOT 3
- Generate full report from quicktest
- Issue with updating traffic item attributes with RestPy HOT 5
- Type Annotation HOT 2
- Not all vports find at first iteration of script HOT 2
- ixnetwork.Timeline.CreateTest(Arg2="rfc2544back2back", Arg3="none") returns error
- writing quicktest testconfig works in 1.1.4 not working in 1.1.5 HOT 1
- Read content of Multivalue HOT 7
- PimV4SourcesList HOT 1
- AppErrors
- enable port FramePreemption Error
- Multivalue Overlay error (PIMv4 Interface.Active)
- InstanceId is not a string HOT 4
- Getting warning "Unable to connect to http://10.10.10.10:11009"
- Locking Up Asyncio Event Loop HOT 2
- System.Exception: InstanceId is not a string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ixnetwork_restpy.