Hi,
On 2015年01月29日 06:11, Marlon Olaya wrote:
> Hi, I'm triying to get the a flow stat, and i wanna use get_flow_stats(dp,
> waiters) from ryu//lib/ofctl_v1_0.py and I use this function for that:
>
> def statusReq(self, datapath):
> stats =[]
> waiters = {}
> stats= ofctl.get_flow_stats(dp=datapath,waiters=waiters)
> print "Stats of a flow"
> print stats
> return
>
> Im not sure if the code is right, but I get this result when I run the app:
>
> Stats of a flow
> {'14118357615532992': []}
>
> Can you help me to understad how to use this function correctly please?
Requires implementation of the "Stats Reply handler".
Please refer to the following code.
https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L689-L725
(ofctl_rest.py is an application that uses the ofctl_v1_*.py)
> Also im not sure about the parameter "waiters" in the definition of the
> function, what's the meaning of it?
"waiters" has a list of xid of StatsReply waiting in each dpid.
Structure of "waiters" are as follows.
{dpid: {xid: (<ryu.lib.hub.Event object>, msgs)}, dpid: {xid: ....}
Therefore, the value of each xid will be removed in the following timing.
* When StatsReply received
https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L724
* When StatsReply timeout
https://github.com/osrg/ryu/blob/master/ryu/lib/ofctl_v1_0.py#L252-L254
>
> Regards.
> Marlon Olaya
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel