diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-28 00:10:43 -0700 |
---|---|---|
committer | Edward MacGillivray <edward.s.macgillivray@intel.com> | 2017-10-02 16:26:26 -0700 |
commit | 0eccf0cb46496b4a0fc1865f2c2c40d226697853 (patch) | |
tree | ead6c52b041bce0caa15b36d49f5f92c18d4bf20 /yardstick/network_services/nfvi/resource.py | |
parent | 77c7d358bc6a61e2a5c24c6056cc3e40561f27c7 (diff) |
add collectd resource node capability
allow manually adding collectd nodes using Node context.
if a node is present with a collectd config dict then
we can create a ResourceProfile object for it
and connect to collectd.
example
nodes:
-
name: compute_0
role: Compute
ip: 1.1.1.1
user: root
password: r00t
collectd:
interval: 5
plugins:
ovs_stats: {}
Change-Id: Ie0c00fdb58373206071daa1fb13faf175c4313e0
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/network_services/nfvi/resource.py')
-rw-r--r-- | yardstick/network_services/nfvi/resource.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py index d807f5e46..7e8334c73 100644 --- a/yardstick/network_services/nfvi/resource.py +++ b/yardstick/network_services/nfvi/resource.py @@ -51,16 +51,26 @@ class ResourceProfile(object): COLLECTD_CONF = "collectd.conf" AMPQ_PORT = 5672 DEFAULT_INTERVAL = 25 + DEFAULT_TIMEOUT = 3600 + + def __init__(self, mgmt, port_names=None, cores=None, plugins=None, + interval=None, timeout=None): - def __init__(self, mgmt, port_names=None, cores=None, plugins=None, interval=None): if plugins is None: self.plugins = {} else: self.plugins = plugins + if interval is None: self.interval = self.DEFAULT_INTERVAL else: self.interval = interval + + if timeout is None: + self.timeout = self.DEFAULT_TIMEOUT + else: + self.timeout = timeout + self.enable = True self.cores = validate_non_string_sequence(cores, default=[]) self._queue = multiprocessing.Queue() @@ -73,8 +83,8 @@ class ResourceProfile(object): def check_if_sa_running(self, process): """ verify if system agent is running """ - err, pid, _ = self.connection.execute("pgrep -f %s" % process) - return [err == 0, pid] + status, pid, _ = self.connection.execute("pgrep -f %s" % process) + return status == 0, pid def run_collectd_amqp(self): """ run amqp consumer to collect the NFVi data """ |