Hi Alicja, Please see inline ... On Apr 3, 2015, at 3:10 AM, Alicja Celigowska <alicja.celigow...@codilime.com<mailto:alicja.celigow...@codilime.com>> wrote:
Hi I have a question about Opserver module in contrail-controller. There is a little problem when I want to gather information about network traffic (in_bytes, out_bytes per virtual machine): Returned values informs about traffic in last hour. It would be good to be able to customize this time. I looked at source code, to find out what can I do with this and then I saw this: q["query"]["start_time"] = qdict["end_time"] - (3600 * 1000000) Could we change this to: q["query"]["start_time"] = qdict["end_time"] - (period * 1000000) ? Additional parameter could be passed with GET request. By default it could be 3600 as before. [Megh]: The GET is just used to reflect the operational state of the virtual machine/virtual network and the stats shown over there do not support a whole lot of query parameters as pointed out by you. We have a POST API to do the query and in there the start and end time are given by the user. The URL is http://<analytics-node-ip>:8081/analytics/query. In fact, we support aggregations like SUM, COUNT, MIN, MAX over there. There is a python script (contrail-stats) that does the POST and queries the Opserver. You can also use the browser with REST client/ POSTMAN or the UI to do the same query. For example, for the example above, you can run the following: contrail-stats --table UveVirtualNetworkAgent.vn_stats --select "SUM(vn_stats.in_tpkts)" vn_stats.other_vn --where name="default-domain:default-project:default-virtual-network" --start-time now-1m --end-time now Please check contrail-stats —help to see list of statistics and query options supported. Also, there is one more problem with tests in opserver. If I run: "scons controller/src/opserver:test" it fails with: PyTestSuiteCov(["build/debug/opserver/test/opserver-test"], ["build/debug/opserver/test/uveserver_test.py", "build/debug/opserver/test/analytics_uvetest.py", "build/debug/opserver/test/analytics_systest.py", "build/debug/opserver/test/analytics_statstest.py", "build/debug/opserver/test/analytics_db_test.py", "build/debug/opserver/test/overlay_to_underlay_mapper_test.py"]) /home/ubuntu/contrail_source/build/debug/opserver/test/uveserver_test.py PASS /home/ubuntu/contrail_source/build/debug/opserver/test/analytics_uvetest.py FAIL If I run this test manually (activating analytics_test env before) I see a lot of "Connection refused" error messages. It seems like I need to run it in complete environment (with working controller). At least it should be excluded from tests suite? [Megh]: Can you please check the build/debug/opserver/test/analytics_uvetest.py.log for the errors. The test does require cassandra, redis and so might fail if those are not installed. Thanks Megh Have a nice day -- Alicja Celigowska Software Engineer [http://i.imgur.com/dxdOkEX.jpg] --------------------------------- M: +48 531 033 070 E: alicja.celigow...@codilime.com<mailto:alicja.celigow...@codilime.com> --------------------------------- CodiLime Sp. z o.o. - Ltd. company with its registered office in Poland, 01-167 Warsaw, ul. Zawiszy 14/97. Registered by The District Court for the Capital City of Warsaw, XII Commercial Department of the National Court Register. Entered into National Court Register under No. KRS 0000388871. Tax identification number (NIP) 5272657478. Statistical number (REGON) 142974628. ----------------------------------------- The information in this email is confidential and may be legally privileged, it may contain information that is confidential in CodiLime Sp. z o.o. It is intended solely for the addressee. Any access to this email by third parties is unauthorized. If you are not the intended recipient of this message, any disclosure, copying, distribution or any action undertaken or neglected in reliance thereon is prohibited and may result in your liability for damages. <opserver.patch>_______________________________________________ Dev mailing list Dev@lists.opencontrail.org<mailto:Dev@lists.opencontrail.org> http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org
_______________________________________________ Dev mailing list Dev@lists.opencontrail.org http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org