)]}'
{"README.md":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"6377eb71285d9033936ad2bf80e686947df0b54a","unresolved":false,"context_lines":[{"line_number":946,"context_line":"The Libvirt plugin provides metrics for virtual machines when run on the hypervisor server.  It provides two sets of metrics per measurement: one designed for the owner of the VM, and one intended for the owner of the hypervisor server."},{"line_number":947,"context_line":""},{"line_number":948,"context_line":"### Ceilometer"},{"line_number":949,"context_line":"The Libvirt plugin uses Ceilometer\u0027s virtualization inspector code to gather its data.  Ceilometer is not a depencency, though; the inspector code has been stripped and re-packaged with the Monasca Agent."},{"line_number":950,"context_line":""},{"line_number":951,"context_line":"### Configuration"},{"line_number":952,"context_line":"The `monasca-setup` program will configure the Libvirt plugin if `nova-api` is running, `/etc/nova/nova.conf` exists, and `python-novaclient` is installed.  It uses a cache directory to persist data, which is `/dev/shm` by default.  On non-Linux systems (BSD, Mac OSX), `/dev/shm` may not exist, so `cache_dir` would need to be changed accordingly, either in `monsetup/detection/plugins/libvirt.py` prior to running `monasca-setup`, or `/etc/monasca/agent/conf.d/libvirt.yaml` afterwards."}],"source_content_type":"text/x-gfm","patch_set":3,"id":"baa201ad_0166f850","line":949,"updated":"2014-10-16 18:25:59.000000000","message":"I\u0027m not sure we should mention this. Not because I don\u0027t want to give them credit, but more because for the user\u0027s reading this documentation just want to know how to configure the agent.","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"240893a22a7d295db49464201ca6e4a83b9a9f01","unresolved":false,"context_lines":[{"line_number":946,"context_line":"The Libvirt plugin provides metrics for virtual machines when run on the hypervisor server.  It provides two sets of metrics per measurement: one designed for the owner of the VM, and one intended for the owner of the hypervisor server."},{"line_number":947,"context_line":""},{"line_number":948,"context_line":"### Ceilometer"},{"line_number":949,"context_line":"The Libvirt plugin uses Ceilometer\u0027s virtualization inspector code to gather its data.  Ceilometer is not a depencency, though; the inspector code has been stripped and re-packaged with the Monasca Agent."},{"line_number":950,"context_line":""},{"line_number":951,"context_line":"### Configuration"},{"line_number":952,"context_line":"The `monasca-setup` program will configure the Libvirt plugin if `nova-api` is running, `/etc/nova/nova.conf` exists, and `python-novaclient` is installed.  It uses a cache directory to persist data, which is `/dev/shm` by default.  On non-Linux systems (BSD, Mac OSX), `/dev/shm` may not exist, so `cache_dir` would need to be changed accordingly, either in `monsetup/detection/plugins/libvirt.py` prior to running `monasca-setup`, or `/etc/monasca/agent/conf.d/libvirt.yaml` afterwards."}],"source_content_type":"text/x-gfm","patch_set":3,"id":"baa201ad_c00771c8","line":949,"in_reply_to":"baa201ad_0166f850","updated":"2014-10-17 16:58:02.000000000","message":"Done","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"}],"monagent/collector/checks/check.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"6377eb71285d9033936ad2bf80e686947df0b54a","unresolved":false,"context_lines":[{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        :param metric: The name of the metric"},{"line_number":322,"context_line":"        :param value: The value of the gauge"},{"line_number":323,"context_line":"        :param dimensions: (optional) A dictionary of dimensions for this metric"},{"line_number":324,"context_line":"        :param hostname: (optional) A hostname for this metric. Defaults to the current hostname."},{"line_number":325,"context_line":"        :param device_name: (optional) The device name for this metric"},{"line_number":326,"context_line":"        :param timestamp: (optional) The timestamp for this metric value"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_4122c0a3","line":323,"updated":"2014-10-16 18:25:59.000000000","message":"Probably should add \"delegated_tenant\" as a param. This comment applies to several other methods in this file.","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"240893a22a7d295db49464201ca6e4a83b9a9f01","unresolved":false,"context_lines":[{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        :param metric: The name of the metric"},{"line_number":322,"context_line":"        :param value: The value of the gauge"},{"line_number":323,"context_line":"        :param dimensions: (optional) A dictionary of dimensions for this metric"},{"line_number":324,"context_line":"        :param hostname: (optional) A hostname for this metric. Defaults to the current hostname."},{"line_number":325,"context_line":"        :param device_name: (optional) The device name for this metric"},{"line_number":326,"context_line":"        :param timestamp: (optional) The timestamp for this metric value"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_e00ab5d0","line":323,"in_reply_to":"baa201ad_4122c0a3","updated":"2014-10-17 16:58:02.000000000","message":"Done","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"}],"monagent/collector/checks_d/libvirt.py":[{"author":{"_account_id":12108,"name":"Gary Hessler","email":"gary.hessler@hp.com","username":"garyh"},"change_message_id":"6608f60e0b9e05bef7b0ea1c8bbc7253b5b39f95","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        id_cache[\u0027last_update\u0027] \u003d int(time.time())"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # Write the updated cache"},{"line_number":49,"context_line":"        with open(self.instance_cache_file, \u0027w\u0027) as cache_yaml:"},{"line_number":50,"context_line":"            yaml.safe_dump(id_cache, cache_yaml)"},{"line_number":51,"context_line":"        os.chmod(self.instance_cache_file, 0600)"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_03710e44","line":49,"updated":"2014-10-13 18:46:24.000000000","message":"I think this could throw an IOError exception.","commit_id":"aa3a8af9b4b8731f86c135fa2fa0d6c2d0f4a2e7"},{"author":{"_account_id":12108,"name":"Gary Hessler","email":"gary.hessler@hp.com","username":"garyh"},"change_message_id":"6608f60e0b9e05bef7b0ea1c8bbc7253b5b39f95","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        # Write the updated cache"},{"line_number":49,"context_line":"        with open(self.instance_cache_file, \u0027w\u0027) as cache_yaml:"},{"line_number":50,"context_line":"            yaml.safe_dump(id_cache, cache_yaml)"},{"line_number":51,"context_line":"        os.chmod(self.instance_cache_file, 0600)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        return id_cache"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_433a3699","line":51,"updated":"2014-10-13 18:46:24.000000000","message":"Why reset the permissions on the cache file every time this method is called?","commit_id":"aa3a8af9b4b8731f86c135fa2fa0d6c2d0f4a2e7"},{"author":{"_account_id":12108,"name":"Gary Hessler","email":"gary.hessler@hp.com","username":"garyh"},"change_message_id":"6608f60e0b9e05bef7b0ea1c8bbc7253b5b39f95","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        return metric_cache"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def _update_metric_cache(self, metric_cache):"},{"line_number":90,"context_line":"        with open(self.metric_cache_file, \u0027w\u0027) as cache_yaml:"},{"line_number":91,"context_line":"            yaml.safe_dump(metric_cache, cache_yaml)"},{"line_number":92,"context_line":"        os.chmod(self.metric_cache_file, 0600)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_e3488ace","line":90,"updated":"2014-10-13 18:46:24.000000000","message":"I think this could throw an IOError exception.","commit_id":"aa3a8af9b4b8731f86c135fa2fa0d6c2d0f4a2e7"},{"author":{"_account_id":12108,"name":"Gary Hessler","email":"gary.hessler@hp.com","username":"garyh"},"change_message_id":"6608f60e0b9e05bef7b0ea1c8bbc7253b5b39f95","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def _update_metric_cache(self, metric_cache):"},{"line_number":90,"context_line":"        with open(self.metric_cache_file, \u0027w\u0027) as cache_yaml:"},{"line_number":91,"context_line":"            yaml.safe_dump(metric_cache, cache_yaml)"},{"line_number":92,"context_line":"        os.chmod(self.metric_cache_file, 0600)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def check(self, instance):"},{"line_number":95,"context_line":"        \"\"\"Gather VM metrics for each instance\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_a36cc237","line":92,"updated":"2014-10-13 18:46:24.000000000","message":"Why reset the permissions on the cache file every time this method is called?","commit_id":"aa3a8af9b4b8731f86c135fa2fa0d6c2d0f4a2e7"},{"author":{"_account_id":12108,"name":"Gary Hessler","email":"gary.hessler@hp.com","username":"garyh"},"change_message_id":"6608f60e0b9e05bef7b0ea1c8bbc7253b5b39f95","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        instance_cache \u003d self._load_instance_cache()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        # Build dimensions for both the customer and for operations"},{"line_number":104,"context_line":"        dims_base \u003d {\u0027service\u0027: \u0027compute\u0027, \u0027component\u0027: \u0027vm\u0027}"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        insp \u003d inspector.get_hypervisor_inspector()"},{"line_number":107,"context_line":"        for inst in insp.inspect_instances():"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_cec72d63","line":104,"updated":"2014-10-13 18:46:24.000000000","message":"This variable is only used in one place.  Why create a variable and then copy it to another variable?","commit_id":"aa3a8af9b4b8731f86c135fa2fa0d6c2d0f4a2e7"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"6377eb71285d9033936ad2bf80e686947df0b54a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/bin/env python"},{"line_number":2,"context_line":"\"\"\"Monasca Agent interface for libvirt metrics\"\"\""},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"import os"},{"line_number":5,"context_line":"import stat"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_c1e07028","line":2,"updated":"2014-10-16 18:25:59.000000000","message":"Should add the HP Copyright and Apache 2 license.","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"240893a22a7d295db49464201ca6e4a83b9a9f01","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/bin/env python"},{"line_number":2,"context_line":"\"\"\"Monasca Agent interface for libvirt metrics\"\"\""},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"import os"},{"line_number":5,"context_line":"import stat"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_60ade530","line":2,"in_reply_to":"baa201ad_c1e07028","updated":"2014-10-17 16:58:02.000000000","message":"Done","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"6377eb71285d9033936ad2bf80e686947df0b54a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"from calendar import timegm"},{"line_number":10,"context_line":"from datetime import datetime"},{"line_number":11,"context_line":"from monagent.collector.virt import inspector"},{"line_number":12,"context_line":"from monagent.collector.checks import AgentCheck"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"class LibvirtCheck(AgentCheck):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_c1b7901f","line":12,"updated":"2014-10-16 18:25:59.000000000","message":"Can we make a note to convert over to monasca_agent instead of monagent? It would be nice to just clean this part up.","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"240893a22a7d295db49464201ca6e4a83b9a9f01","unresolved":false,"context_lines":[{"line_number":9,"context_line":"from calendar import timegm"},{"line_number":10,"context_line":"from datetime import datetime"},{"line_number":11,"context_line":"from monagent.collector.virt import inspector"},{"line_number":12,"context_line":"from monagent.collector.checks import AgentCheck"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"class LibvirtCheck(AgentCheck):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_5b7452ce","line":12,"in_reply_to":"baa201ad_c1b7901f","updated":"2014-10-17 16:58:02.000000000","message":"Done","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"6377eb71285d9033936ad2bf80e686947df0b54a","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        for instance in instances:"},{"line_number":52,"context_line":"            # Skip deleted instances"},{"line_number":53,"context_line":"            if instance.__getattr__(\u0027OS-SRV-USG:terminated_at\u0027) is not None:"},{"line_number":54,"context_line":"                continue"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            inst_name \u003d instance.__getattr__(\u0027OS-EXT-SRV-ATTR:instance_name\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_c1c1504f","line":53,"updated":"2014-10-16 18:25:59.000000000","message":"I was just wondering why __getattr__ was being used here.\n\nAdditionally, note that __getattr__ can raise an AttributeError exception. If that occurs, that exception will force this method to exit. Is that what you wanted to happen?","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"240893a22a7d295db49464201ca6e4a83b9a9f01","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        for instance in instances:"},{"line_number":52,"context_line":"            # Skip deleted instances"},{"line_number":53,"context_line":"            if instance.__getattr__(\u0027OS-SRV-USG:terminated_at\u0027) is not None:"},{"line_number":54,"context_line":"                continue"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            inst_name \u003d instance.__getattr__(\u0027OS-EXT-SRV-ATTR:instance_name\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_60232505","line":53,"in_reply_to":"baa201ad_c1c1504f","updated":"2014-10-17 16:58:02.000000000","message":"After additional perusing of the novaclient code, this section isn\u0027t even necessary.  Unless \"\u0027deleted\u0027: 1\" is passed in search_opts, deleted instances will never appear in nova_client.servers.list().","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"}],"monagent/collector/virt/hyperv/inspector.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"6377eb71285d9033936ad2bf80e686947df0b54a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from monagent.collector.virt.hyperv import utilsv2"},{"line_number":23,"context_line":"from monagent.collector.virt import inspector as virt_inspector"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"CONF \u003d cfg.CONF"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class HyperVInspector(virt_inspector.Inspector):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_21985c69","line":25,"updated":"2014-10-16 18:25:59.000000000","message":"cfg and CONF are not used in the code below","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"240893a22a7d295db49464201ca6e4a83b9a9f01","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from monagent.collector.virt.hyperv import utilsv2"},{"line_number":23,"context_line":"from monagent.collector.virt import inspector as virt_inspector"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"CONF \u003d cfg.CONF"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class HyperVInspector(virt_inspector.Inspector):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_f61efb5d","line":25,"in_reply_to":"baa201ad_21985c69","updated":"2014-10-17 16:58:02.000000000","message":"Removed.  utilsv2.py was the same way.","commit_id":"bf3a30e075d9d616622e84713a2cfc195f9c486e"}]}
