diff options
author | Peter Mikus <pmikus@cisco.com> | 2019-08-30 13:20:14 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-09-10 07:28:44 +0000 |
commit | c4528bcd137c0813d34b1b248bc92670736e78e6 (patch) | |
tree | ca5ea6a5b6846dfbc0c7c1937dd1e6a6e469a985 /resources/libraries/python/ContainerUtils.py | |
parent | 7232ab0e49554a653f3527df5a2ba055f804a4fb (diff) |
Refactor getting telemetry
+ Ability to get stats from CNF via SocketPAPI
- Remove obsolete functions
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I4d1b32a7279244592be96644e4f8a530c4f29a15
Diffstat (limited to 'resources/libraries/python/ContainerUtils.py')
-rw-r--r-- | resources/libraries/python/ContainerUtils.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index 363411c070..cd48fc6c1f 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -21,7 +21,7 @@ from collections import OrderedDict, Counter from resources.libraries.python.ssh import SSH from resources.libraries.python.Constants import Constants -from resources.libraries.python.topology import Topology +from resources.libraries.python.topology import Topology, SocketType from resources.libraries.python.VppConfigGenerator import VppConfigGenerator @@ -430,6 +430,22 @@ class ContainerEngine(object): self.execute('supervisorctl reload') self.execute('supervisorctl start vpp') + from robot.libraries.BuiltIn import BuiltIn + topo_instance = BuiltIn().get_library_instance( + 'resources.libraries.python.topology.Topology') + topo_instance.add_new_socket( + self.container.node, + SocketType.PAPI, + self.container.name, + '{root}/tmp/vpp_sockets/{name}/api.sock'. + format(root=self.container.root, name=self.container.name)) + topo_instance.add_new_socket( + self.container.node, + SocketType.STATS, + self.container.name, + '{root}/tmp/vpp_sockets/{name}/stats.sock'. + format(root=self.container.root, name=self.container.name)) + def restart_vpp(self): """Restart VPP service inside a container.""" self.execute('supervisorctl restart vpp') @@ -449,7 +465,8 @@ class ContainerEngine(object): vpp_config.add_unix_cli_listen() vpp_config.add_unix_nodaemon() vpp_config.add_unix_exec('/tmp/running.exec') - vpp_config.add_socksvr() + vpp_config.add_socksvr(socket=Constants.SOCKSVR_PATH) + vpp_config.add_statseg_per_node_counters(value='on') # We will pop the first core from the list to be a main core vpp_config.add_cpu_main_core(str(cpuset_cpus.pop(0))) # If more cores in the list, the rest will be used as workers. @@ -499,7 +516,8 @@ class ContainerEngine(object): vpp_config.add_unix_cli_listen() vpp_config.add_unix_nodaemon() vpp_config.add_unix_exec('/tmp/running.exec') - vpp_config.add_socksvr() + vpp_config.add_socksvr(socket=Constants.SOCKSVR_PATH) + vpp_config.add_statseg_per_node_counters(value='on') vpp_config.add_plugin('disable', 'dpdk_plugin.so') # Apply configuration |