)]}'
{"nova/compute/monitors/__init__.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        result[\u0027value\u0027] \u003d metric_value"},{"line_number":69,"context_line":"        result[\u0027timestamp\u0027] \u003d timestamp or timeutils.utcnow()"},{"line_number":70,"context_line":"        try:"},{"line_number":71,"context_line":"            result[\u0027source\u0027] \u003d self.source"},{"line_number":72,"context_line":"        except AttributeError:"},{"line_number":73,"context_line":"            result[\u0027source\u0027] \u003d None"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fjcc%3D","line":71,"updated":"2013-09-03 18:29:01.000000000","message":"It\u0027s a little odd referencing self.source, which doesn\u0027t exist in the base class.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        result[\u0027value\u0027] \u003d metric_value"},{"line_number":69,"context_line":"        result[\u0027timestamp\u0027] \u003d timestamp or timeutils.utcnow()"},{"line_number":70,"context_line":"        try:"},{"line_number":71,"context_line":"            result[\u0027source\u0027] \u003d self.source"},{"line_number":72,"context_line":"        except AttributeError:"},{"line_number":73,"context_line":"            result[\u0027source\u0027] \u003d None"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Ff08%3D","line":71,"in_reply_to":"AAAASn%2F%2Fjcc%3D","updated":"2013-09-05 06:44:51.000000000","message":"OK, I added \u0027source\u0027 member in the base class and set it to None as the default value.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    \"\"\"Base class to handle loading monitor classes."},{"line_number":80,"context_line":"    \"\"\""},{"line_number":81,"context_line":"    def __init__(self):"},{"line_number":82,"context_line":"        super(ResourceMonitorHandler, self).__init__("},{"line_number":83,"context_line":"            ResourceMonitorBase)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FjcQ%3D","line":82,"updated":"2013-09-03 18:29:01.000000000","message":"1 line would easily fit 80 chars","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    \"\"\"Base class to handle loading monitor classes."},{"line_number":80,"context_line":"    \"\"\""},{"line_number":81,"context_line":"    def __init__(self):"},{"line_number":82,"context_line":"        super(ResourceMonitorHandler, self).__init__("},{"line_number":83,"context_line":"            ResourceMonitorBase)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Ff1g%3D","line":82,"in_reply_to":"AAAASn%2F%2FjcQ%3D","updated":"2013-09-05 06:44:51.000000000","message":"Done","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    \"\"\"Base class for resource monitors"},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    __metaclass__ \u003d ResourceMonitorMeta"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, parent):"},{"line_number":70,"context_line":"        self.compute_manager \u003d parent"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FILw%3D","line":67,"updated":"2013-10-22 19:33:22.000000000","message":"Consider using the \"@six.add_metaclass()\" decorator on ResourceMonitorBase.  Under Python 3.3, metaclasses are specified as a keyword argument, as opposed to this Python 2 syntax, and the decorator glosses over the difference.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    \"\"\"Base class for resource monitors"},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    __metaclass__ \u003d ResourceMonitorMeta"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, parent):"},{"line_number":70,"context_line":"        self.compute_manager \u003d parent"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDis%3D","line":67,"in_reply_to":"AAAATH%2F%2FILw%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    \"\"\"Base class to handle loading monitor classes."},{"line_number":113,"context_line":"    \"\"\""},{"line_number":114,"context_line":"    def __init__(self):"},{"line_number":115,"context_line":"        super(ResourceMonitorHandler, self).__init__(ResourceMonitorBase)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def all_monitors():"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FINo%3D","line":115,"updated":"2013-10-22 19:33:22.000000000","message":"This \"__init__()\" method is unneeded.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    \"\"\"Base class to handle loading monitor classes."},{"line_number":113,"context_line":"    \"\"\""},{"line_number":114,"context_line":"    def __init__(self):"},{"line_number":115,"context_line":"        super(ResourceMonitorHandler, self).__init__(ResourceMonitorBase)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def all_monitors():"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDio%3D","line":115,"in_reply_to":"AAAATH%2F%2FINo%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"}],"nova/compute/monitors/cpu_monitor.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.compute import monitors"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class _CPUMonitorBase(monitors.ResourceMonitorBase):"},{"line_number":25,"context_line":"    \"\"\"CPU monitor base.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __init__(self, parent):"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FidM%3D","line":24,"updated":"2013-09-03 18:29:01.000000000","message":"I don\u0027t quite understand the division of labor between this base class and nova.compute.monitors.virt.cpu_monitor.ComputeDriverCPUMonitor\n\nIs separating the two providing value somehow, or should they be collapsed together for simplicity/readability?","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.compute import monitors"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class _CPUMonitorBase(monitors.ResourceMonitorBase):"},{"line_number":25,"context_line":"    \"\"\"CPU monitor base.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __init__(self, parent):"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FfeQ%3D","line":24,"in_reply_to":"AAAASn%2F%2FidM%3D","updated":"2013-09-05 06:44:51.000000000","message":"_CPUMonitorBase is generically to define which metrics are hoped to get from the CPU monitor (plugin). However, nova.compute.monitors.virt.cpu_monitor.ComputeDriverCPUMonitor is to have a default implementation with virt driver. Certainly not all of the metrics are retrieved by virt drivers, users are allowed to use their own approaches to implement their own CPU monitors.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    def __init__(self, parent):"},{"line_number":28,"context_line":"        super(_CPUMonitorBase, self).__init__(parent)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def get_metric_names(self):"},{"line_number":31,"context_line":"        return [\"cpu.frequency\","},{"line_number":32,"context_line":"            \"cpu.user.time\","},{"line_number":33,"context_line":"            \"cpu.kernel.time\","}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FibY%3D","line":30,"updated":"2013-09-03 18:29:01.000000000","message":"Could probably be slightly clever and generate this list via decorators or a metaclass in tandem with opinionated naming of the getter methods.  (Basically, just add something to keep track of all the metrics within the class.)\n\nI think you also get a simpler implementation of get_metrics() for free if you do this.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    def __init__(self, parent):"},{"line_number":28,"context_line":"        super(_CPUMonitorBase, self).__init__(parent)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def get_metric_names(self):"},{"line_number":31,"context_line":"        return [\"cpu.frequency\","},{"line_number":32,"context_line":"            \"cpu.user.time\","},{"line_number":33,"context_line":"            \"cpu.kernel.time\","}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FfHI%3D","line":30,"in_reply_to":"AAAASn%2F%2FibY%3D","updated":"2013-09-05 06:44:51.000000000","message":"Done","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            \"cpu.iowait.percent\","},{"line_number":40,"context_line":"            \"cpu.percent\"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":43,"context_line":"        \"\"\"Return CPU current frequency and its timestamp.\"\"\""},{"line_number":44,"context_line":"        return None, None"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FidE%3D","line":42,"updated":"2013-09-03 18:29:01.000000000","message":"What\u0027s supposed to call these?  What would you use kwargs for?\n\nDid you consider using a @property decorator on these?  It\u0027d be more pythonic than creating get_* methods manually.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            \"cpu.iowait.percent\","},{"line_number":40,"context_line":"            \"cpu.percent\"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":43,"context_line":"        \"\"\"Return CPU current frequency and its timestamp.\"\"\""},{"line_number":44,"context_line":"        return None, None"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FfXo%3D","line":42,"in_reply_to":"AAAASn%2F%2FidE%3D","updated":"2013-09-05 06:44:51.000000000","message":"only the internal method get_metrics() will call these functions. kwargs is used here given the user will pass some values to a monitor to retrieve the metrics. Here we can\u0027t suppose how users implement their own CPU monitors.\n\nSorry, I need to call get_frequency(kwargs)... with kwargs in get_metrics(). I will update it.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        \"\"\"Return generic CPU utilization and its timestamp.\"\"\""},{"line_number":80,"context_line":"        return None, None"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_metrics(self, **kwargs):"},{"line_number":83,"context_line":"        data \u003d []"},{"line_number":84,"context_line":"        ret \u003d self.get_frequency()"},{"line_number":85,"context_line":"        data.append(self._populate(\"cpu.frequency\", ret[0], ret[1]))"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fia8%3D","line":82,"updated":"2013-09-03 18:29:01.000000000","message":"Nothing populates the actual metric values in the base class.  Is this intended?  If the class doesn\u0027t work in isolation, you might as well tag these methods as abstract.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        \"\"\"Return generic CPU utilization and its timestamp.\"\"\""},{"line_number":80,"context_line":"        return None, None"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_metrics(self, **kwargs):"},{"line_number":83,"context_line":"        data \u003d []"},{"line_number":84,"context_line":"        ret \u003d self.get_frequency()"},{"line_number":85,"context_line":"        data.append(self._populate(\"cpu.frequency\", ret[0], ret[1]))"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FfWw%3D","line":82,"in_reply_to":"AAAASn%2F%2Fia8%3D","updated":"2013-09-05 06:44:51.000000000","message":"I could tag get_xxxx() above as abstract methods. For the classes, yes, it is intended, see my explanations above. do you agree?","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \"\"\"CPU monitor base.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __init__(self, parent):"},{"line_number":28,"context_line":"        super(_CPUMonitorBase, self).__init__(parent)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    @monitors.metric_method(\"cpu.frequency\")"},{"line_number":31,"context_line":"    def get_frequency(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FINk%3D","line":28,"updated":"2013-10-22 19:33:22.000000000","message":"This \"__init__()\" method is unneeded.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \"\"\"CPU monitor base.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __init__(self, parent):"},{"line_number":28,"context_line":"        super(_CPUMonitorBase, self).__init__(parent)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    @monitors.metric_method(\"cpu.frequency\")"},{"line_number":31,"context_line":"    def get_frequency(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDik%3D","line":28,"in_reply_to":"AAAATH%2F%2FINk%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"}],"nova/compute/monitors/virt/__init__.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from nova.compute.monitors.virt import cpu_monitor"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"ComputeDriverCPUMonitor \u003d \\"},{"line_number":20,"context_line":"    cpu_monitor.ComputeDriverCPUMonitor"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FINc%3D","line":20,"updated":"2013-10-22 19:33:22.000000000","message":"Please eliminate the backslash continuation here.  As far as I can see, this whole assignment will fit into a single 79-column line.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from nova.compute.monitors.virt import cpu_monitor"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"ComputeDriverCPUMonitor \u003d \\"},{"line_number":20,"context_line":"    cpu_monitor.ComputeDriverCPUMonitor"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDic%3D","line":20,"in_reply_to":"AAAATH%2F%2FINc%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"}],"nova/compute/monitors/virt/cpu_monitor.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class ComputeDriverCPUMonitor(monitor._CPUMonitorBase):"},{"line_number":35,"context_line":"    \"\"\"CPU monitor based on compute driver"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    The class inherits from the base class for resource monitors,"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiZY%3D","line":34,"updated":"2013-09-03 18:29:01.000000000","message":"The package nova.compute.monitors.virt implies there will be other sub-packages under virt?  Can you give an example?  If not, maybe just simplify if to nova.compute.monitors.\n\nAlso, same comment as in the base class that I don\u0027t understand why the two classes are separated.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class ComputeDriverCPUMonitor(monitor._CPUMonitorBase):"},{"line_number":35,"context_line":"    \"\"\"CPU monitor based on compute driver"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    The class inherits from the base class for resource monitors,"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fc5g%3D","line":34,"in_reply_to":"AAAASn%2F%2FiZY%3D","updated":"2013-09-05 06:44:51.000000000","message":"that is a default implementation. If cpu monitor is implemented by psutils, say, another library to retrieve the cpu information. It could be in nova.compute.monitors.psutil. You can see also https://review.openstack.org/#/c/44007/, which is for network by psutils.\n\nAgain, under virt, there are going to be \"network\", \"disk\", ...\n\nFor the second question, see my reply embedded in the other py file.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self._cpu_stats \u003d {}"},{"line_number":51,"context_line":"        self._data \u003d {}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def add_timestamp(f):"},{"line_number":54,"context_line":"        def wrapper(self, **kwargs):"},{"line_number":55,"context_line":"            self._update_cpustat()"},{"line_number":56,"context_line":"            return f(self, **kwargs), self._data.get(\"timestamp\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiZQ%3D","line":53,"updated":"2013-09-03 18:29:01.000000000","message":"The name is slightly deceiving as this is the actual mechanism that populates the stats.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self._cpu_stats \u003d {}"},{"line_number":51,"context_line":"        self._data \u003d {}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def add_timestamp(f):"},{"line_number":54,"context_line":"        def wrapper(self, **kwargs):"},{"line_number":55,"context_line":"            self._update_cpustat()"},{"line_number":56,"context_line":"            return f(self, **kwargs), self._data.get(\"timestamp\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fc5A%3D","line":53,"in_reply_to":"AAAASn%2F%2FiZQ%3D","updated":"2013-09-05 06:44:51.000000000","message":"? It is only to add a timestamp which indicates when the value was got. Any suggestion for the name?","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        return wrapper"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @add_timestamp"},{"line_number":60,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":61,"context_line":"        return self._data.get(\"cpu.frequency\")"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @add_timestamp"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiZE%3D","line":60,"updated":"2013-09-03 18:29:01.000000000","message":"Same deal with @property decorators versus manual getter methods.\n\nAlternatively you could subclass dict and look up the self._data dictionary value directly.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        return wrapper"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @add_timestamp"},{"line_number":60,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":61,"context_line":"        return self._data.get(\"cpu.frequency\")"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @add_timestamp"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fc4I%3D","line":60,"in_reply_to":"AAAASn%2F%2FiZE%3D","updated":"2013-09-05 06:44:51.000000000","message":"that is not for external but for get_metrics() only. Any user-defined cpu monitor has to implement the method.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":115,"context_line":"            self._data[\"cpu.idle.time\"] \u003d stats[\"idle\"]"},{"line_number":116,"context_line":"            self._data[\"cpu.iowait.time\"] \u003d stats[\"iowait\"]"},{"line_number":117,"context_line":"            self._data[\"cpu.frequency\"] \u003d stats[\"frequency\"]"},{"line_number":118,"context_line":"        except Exception as ex:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Not all properties needed are implemented \""},{"line_number":120,"context_line":"                \"in the compute driver: %s\"), ex)"},{"line_number":121,"context_line":"            raise exception.ResourceMonitorError("}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiYQ%3D","line":118,"updated":"2013-09-03 18:29:01.000000000","message":"The exception type is pretty broad.  This may mask other problems where we\u0027d want to see the traceback.  Either find a more specific one or re-raise the original trace.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":115,"context_line":"            self._data[\"cpu.idle.time\"] \u003d stats[\"idle\"]"},{"line_number":116,"context_line":"            self._data[\"cpu.iowait.time\"] \u003d stats[\"iowait\"]"},{"line_number":117,"context_line":"            self._data[\"cpu.frequency\"] \u003d stats[\"frequency\"]"},{"line_number":118,"context_line":"        except Exception as ex:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Not all properties needed are implemented \""},{"line_number":120,"context_line":"                \"in the compute driver: %s\"), ex)"},{"line_number":121,"context_line":"            raise exception.ResourceMonitorError("}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fc4A%3D","line":118,"in_reply_to":"AAAASn%2F%2FiYQ%3D","updated":"2013-09-05 06:44:51.000000000","message":"Done","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            self._data[\"cpu.iowait.time\"] \u003d stats[\"iowait\"]"},{"line_number":117,"context_line":"            self._data[\"cpu.frequency\"] \u003d stats[\"frequency\"]"},{"line_number":118,"context_line":"        except Exception as ex:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Not all properties needed are implemented \""},{"line_number":120,"context_line":"                \"in the compute driver: %s\"), ex)"},{"line_number":121,"context_line":"            raise exception.ResourceMonitorError("},{"line_number":122,"context_line":"                monitor\u003dself.__class__.__name__)"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiYI%3D","line":119,"updated":"2013-09-03 18:29:01.000000000","message":"So this is essentially a configuration problem of choosing to use a monitor that your virt driver doesn\u0027t support?","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            self._data[\"cpu.iowait.time\"] \u003d stats[\"iowait\"]"},{"line_number":117,"context_line":"            self._data[\"cpu.frequency\"] \u003d stats[\"frequency\"]"},{"line_number":118,"context_line":"        except Exception as ex:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Not all properties needed are implemented \""},{"line_number":120,"context_line":"                \"in the compute driver: %s\"), ex)"},{"line_number":121,"context_line":"            raise exception.ResourceMonitorError("},{"line_number":122,"context_line":"                monitor\u003dself.__class__.__name__)"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fcvg%3D","line":119,"in_reply_to":"AAAASn%2F%2FiYI%3D","updated":"2013-09-05 06:44:51.000000000","message":"Daniel has suggested me to add a function get_host_cpu_stats() in common virt driver, and that was implemented in libvirt. If a virt driver doesn\u0027t support that the NotImplementedError will be thrown out, and the caller (see https://review.openstack.org/#/c/35767/) will catch it and skip it. That won\u0027t cause any crash but there is no data for CPU.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        # We compute the utilization percentages for each specific CPU time"},{"line_number":126,"context_line":"        # after calculating the delta between the current reading and the"},{"line_number":127,"context_line":"        # previous reading."},{"line_number":128,"context_line":"        stats[\"total\"] \u003d stats[\"user\"] + stats[\"kernel\"] \\"},{"line_number":129,"context_line":"                         + stats[\"idle\"] + stats[\"iowait\"]"},{"line_number":130,"context_line":"        cputime \u003d float(stats[\"total\"] - self._cpu_stats.get(\"total\", 0))"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiX4%3D","line":128,"updated":"2013-09-03 18:29:01.000000000","message":"Wrap the math in () rather than use the line continuation operator.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        # We compute the utilization percentages for each specific CPU time"},{"line_number":126,"context_line":"        # after calculating the delta between the current reading and the"},{"line_number":127,"context_line":"        # previous reading."},{"line_number":128,"context_line":"        stats[\"total\"] \u003d stats[\"user\"] + stats[\"kernel\"] \\"},{"line_number":129,"context_line":"                         + stats[\"idle\"] + stats[\"iowait\"]"},{"line_number":130,"context_line":"        cputime \u003d float(stats[\"total\"] - self._cpu_stats.get(\"total\", 0))"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FcyQ%3D","line":128,"in_reply_to":"AAAASn%2F%2FiX4%3D","updated":"2013-09-05 06:44:51.000000000","message":"Done","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"dc12637403f2c95c555ec9eb51e2c4db1472e07a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class ComputeDriverCPUMonitor(monitor._CPUMonitorBase):"},{"line_number":36,"context_line":"    \"\"\"CPU monitor based on compute driver"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    The class inherits from the base class for resource monitors,"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FeAI%3D","line":35,"updated":"2013-10-15 19:37:43.000000000","message":"What\u0027s the logic behind subclassing here?  Would there be 2 different implementations of a CPU monitor for some reason?\n\nAlso, I would think you could get away with using a single nova.compute.monitors package.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class ComputeDriverCPUMonitor(monitor._CPUMonitorBase):"},{"line_number":36,"context_line":"    \"\"\"CPU monitor based on compute driver"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    The class inherits from the base class for resource monitors,"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDXc%3D","line":35,"in_reply_to":"AAAATH%2F%2FeAI%3D","updated":"2013-11-15 08:36:38.000000000","message":"Yes, it could be. Here the monitor is using libvirt to retrieve the data, probably some other impl could use XenAPI, or some vendors use their own approaches. Monitors are thought as a sort of plugins.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"dc12637403f2c95c555ec9eb51e2c4db1472e07a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @monitors.metric_method(\"cpu.frequency\")"},{"line_number":80,"context_line":"    @add_timestamp"},{"line_number":81,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":82,"context_line":"        return self._data.get(\"cpu.frequency\")"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @monitors.metric_method(\"cpu.user.time\")"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2Fd%2F0%3D","line":81,"updated":"2013-10-15 19:37:43.000000000","message":"Rather than decorate nearly every function, why not name the functions according to a convention and use a metaclass to handle this with fewer LOC?","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @monitors.metric_method(\"cpu.frequency\")"},{"line_number":80,"context_line":"    @add_timestamp"},{"line_number":81,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":82,"context_line":"        return self._data.get(\"cpu.frequency\")"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @monitors.metric_method(\"cpu.user.time\")"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FC0s%3D","line":81,"in_reply_to":"AAAATH%2F%2Fd%2F0%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done. For @add_timestamp, I don\u0027t want to put it into a metaclass, because it is only used in this file, it is related to my specific impl for my CPU monitor.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":7664,"name":"Joe Cropper","email":"jwcroppe@us.ibm.com","username":"jwcroppe"},"change_message_id":"6ac3debe565674adbff2bbacba910f75c032f186","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        prev_used \u003d (self._cpu_stats.get(\"user\", 0)"},{"line_number":166,"context_line":"                     + self._cpu_stats.get(\"kernel\", 0)"},{"line_number":167,"context_line":"                     + self._cpu_stats.get(\"iowait\", 0))"},{"line_number":168,"context_line":"        perc \u003d (used - prev_used) / cputime"},{"line_number":169,"context_line":"        self._data[\"cpu.percent\"] \u003d perc"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        self._cpu_stats \u003d stats.copy()"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAUX%2F%2Bqzs%3D","line":168,"updated":"2014-02-19 21:52:16.000000000","message":"Should we protect against division by 0 here?  I\u0027m thinking of cases in which the driver is called too quickly and perhaps the same data is returned?  I realize libvirt may not work this way, but we shouldn\u0027t assume it always differs?","commit_id":"5d6e5e31c49af2312f6577d22bb1d18e6f296667"},{"author":{"_account_id":7641,"name":"Shuangtai Tian","email":"hitianst@gmail.com","username":"shuangtai"},"change_message_id":"670749cf2b9e49179074641a1a297e6e3629d202","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        prev_used \u003d (self._cpu_stats.get(\"user\", 0)"},{"line_number":166,"context_line":"                     + self._cpu_stats.get(\"kernel\", 0)"},{"line_number":167,"context_line":"                     + self._cpu_stats.get(\"iowait\", 0))"},{"line_number":168,"context_line":"        perc \u003d (used - prev_used) / cputime"},{"line_number":169,"context_line":"        self._data[\"cpu.percent\"] \u003d perc"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        self._cpu_stats \u003d stats.copy()"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVX%2F%2FwUU%3D","line":168,"in_reply_to":"AAAAUX%2F%2Bqzs%3D","updated":"2014-02-28 14:35:19.000000000","message":"@Joe Cropper\nI am also confused  this, but the line :121 has a protection. \nI think 1s is enough.","commit_id":"5d6e5e31c49af2312f6577d22bb1d18e6f296667"},{"author":{"_account_id":7641,"name":"Shuangtai Tian","email":"hitianst@gmail.com","username":"shuangtai"},"change_message_id":"81a551f40f04c63619e54b5cf37a65dc07eb794e","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        prev_used \u003d (self._cpu_stats.get(\"user\", 0)"},{"line_number":166,"context_line":"                     + self._cpu_stats.get(\"kernel\", 0)"},{"line_number":167,"context_line":"                     + self._cpu_stats.get(\"iowait\", 0))"},{"line_number":168,"context_line":"        perc \u003d (used - prev_used) / cputime"},{"line_number":169,"context_line":"        self._data[\"cpu.percent\"] \u003d perc"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        self._cpu_stats \u003d stats.copy()"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fzd4%3D","line":168,"in_reply_to":"AAAAVX%2F%2FwHc%3D","updated":"2014-03-04 01:49:37.000000000","message":"@Joe Cropper, the compute monitors plugins would be load every periodic_task. but you are right it\u0027s a risk if the periodic_task \u003c hypervisor refreshes","commit_id":"5d6e5e31c49af2312f6577d22bb1d18e6f296667"},{"author":{"_account_id":7664,"name":"Joe Cropper","email":"jwcroppe@us.ibm.com","username":"jwcroppe"},"change_message_id":"1663d9704827ed6edf768c968e9292928f1ecff3","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        prev_used \u003d (self._cpu_stats.get(\"user\", 0)"},{"line_number":166,"context_line":"                     + self._cpu_stats.get(\"kernel\", 0)"},{"line_number":167,"context_line":"                     + self._cpu_stats.get(\"iowait\", 0))"},{"line_number":168,"context_line":"        perc \u003d (used - prev_used) / cputime"},{"line_number":169,"context_line":"        self._data[\"cpu.percent\"] \u003d perc"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        self._cpu_stats \u003d stats.copy()"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVX%2F%2FwHc%3D","line":168,"in_reply_to":"AAAAVX%2F%2FwUU%3D","updated":"2014-02-28 15:04:40.000000000","message":"Right, line 121 has protection for calls that come in with a frequency higher than 1s.  However, if a hypervisor refreshes its stats only once every 5 seconds (for performance reasons), then calls that come in every {x | 1 \u003c x \u003c 5} seconds could have division by 0.","commit_id":"5d6e5e31c49af2312f6577d22bb1d18e6f296667"}],"nova/compute/plugins/__init__.py":[{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"d5a93f0ccf8d92f58022bb2e1bc313bd554f1521","unresolved":false,"context_lines":[{"line_number":21,"context_line":"that needs to be implemented by Resource Monitor Plug-in."},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from abc import ABCMeta"},{"line_number":25,"context_line":"from abc import abstractmethod"},{"line_number":26,"context_line":"from nova import loadables"},{"line_number":27,"context_line":"from nova.openstack.common import timeutils"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2Fugc%3D","line":24,"updated":"2013-07-12 10:48:31.000000000","message":"Openstack recommended coding style advice against importing objects other than modules: https://github.com/openstack-dev/hacking/blob/master/HACKING.rst#imports","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9e5b35ee763510cd65d4bbc43fcac3fe8690e5ee","unresolved":false,"context_lines":[{"line_number":21,"context_line":"that needs to be implemented by Resource Monitor Plug-in."},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from abc import ABCMeta"},{"line_number":25,"context_line":"from abc import abstractmethod"},{"line_number":26,"context_line":"from nova import loadables"},{"line_number":27,"context_line":"from nova.openstack.common import timeutils"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FqTs%3D","line":24,"in_reply_to":"AAAAP3%2F%2Fugc%3D","updated":"2013-07-15 03:21:27.000000000","message":"Done","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"d5a93f0ccf8d92f58022bb2e1bc313bd554f1521","unresolved":false,"context_lines":[{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from abc import ABCMeta"},{"line_number":25,"context_line":"from abc import abstractmethod"},{"line_number":26,"context_line":"from nova import loadables"},{"line_number":27,"context_line":"from nova.openstack.common import timeutils"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FugY%3D","line":25,"updated":"2013-07-12 10:48:31.000000000","message":"ditto","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9e5b35ee763510cd65d4bbc43fcac3fe8690e5ee","unresolved":false,"context_lines":[{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from abc import ABCMeta"},{"line_number":25,"context_line":"from abc import abstractmethod"},{"line_number":26,"context_line":"from nova import loadables"},{"line_number":27,"context_line":"from nova.openstack.common import timeutils"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FqTo%3D","line":25,"in_reply_to":"AAAAP3%2F%2FugY%3D","updated":"2013-07-15 03:21:27.000000000","message":"Done","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"d5a93f0ccf8d92f58022bb2e1bc313bd554f1521","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    __metaclass__ \u003d ABCMeta"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @abstractmethod"},{"line_number":37,"context_line":"    def __init__(self, parent):"},{"line_number":38,"context_line":"        self.compute_manager \u003d parent"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FugU%3D","line":36,"updated":"2013-07-12 10:48:31.000000000","message":"What\u0027s the rational behind making __init__ abstract ? Just so i can understand, does user **must** override the __init__ method in there plugin classes ?","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9e5b35ee763510cd65d4bbc43fcac3fe8690e5ee","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    __metaclass__ \u003d ABCMeta"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @abstractmethod"},{"line_number":37,"context_line":"    def __init__(self, parent):"},{"line_number":38,"context_line":"        self.compute_manager \u003d parent"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FqTg%3D","line":36,"in_reply_to":"AAAAP3%2F%2FugU%3D","updated":"2013-07-15 03:21:27.000000000","message":"No, it must not. Remove abstract prefix.\n\n\"Done\"","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"c59675f98a7dedafda060f10f180ee0414a26259","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        result[\u0027value\u0027] \u003d metric_value"},{"line_number":69,"context_line":"        if not timestamp:"},{"line_number":70,"context_line":"            timestamp \u003d timeutils.utcnow()"},{"line_number":71,"context_line":"        result[\u0027timestamp\u0027] \u003d timestamp"},{"line_number":72,"context_line":"        try:"},{"line_number":73,"context_line":"            result[\u0027source\u0027] \u003d self.source"},{"line_number":74,"context_line":"        except AttributeError:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAQn%2F%2FqbA%3D","line":71,"updated":"2013-07-25 15:11:16.000000000","message":"lines 69~71\n\n result[\u0027timestamp\u0027] \u003d timestamp or timeutils.utcnow()","commit_id":"bef9da04b39a62b1416bcf3df673329bf22d2f80"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"557dc1c0747508a43e8d20eba07b621ca1d6d029","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        result[\u0027value\u0027] \u003d metric_value"},{"line_number":69,"context_line":"        if not timestamp:"},{"line_number":70,"context_line":"            timestamp \u003d timeutils.utcnow()"},{"line_number":71,"context_line":"        result[\u0027timestamp\u0027] \u003d timestamp"},{"line_number":72,"context_line":"        try:"},{"line_number":73,"context_line":"            result[\u0027source\u0027] \u003d self.source"},{"line_number":74,"context_line":"        except AttributeError:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAQ3%2F%2F4yU%3D","line":71,"in_reply_to":"AAAAQn%2F%2FqbA%3D","updated":"2013-08-15 06:43:03.000000000","message":"Done. I will include your suggestion in the next patchset.","commit_id":"bef9da04b39a62b1416bcf3df673329bf22d2f80"}],"nova/compute/plugins/cpu_monitor_plugin.py":[{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"63168bd613a452c256782fc3811cf2dd0694aefc","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.compute import plugins"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class CPUMonitorPlugin(plugins.ResourceMonitorPluginBase):"},{"line_number":25,"context_line":"    \"\"\"CPU monitor base plugin.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __init__(self, parent):"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAASn%2F%2F590%3D","line":24,"updated":"2013-08-28 06:06:27.000000000","message":"how about name this base class to _CPUMonitorPluginBase() so nova.compute.plugins.all_plugins() won\u0027t expose it?","commit_id":"3603b1f22617b2448cf18ffbde93417a53f0a8ef"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"56d27fb37c3751cdef3ff253472282263b7f8775","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.compute import plugins"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class CPUMonitorPlugin(plugins.ResourceMonitorPluginBase):"},{"line_number":25,"context_line":"    \"\"\"CPU monitor base plugin.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def __init__(self, parent):"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAASn%2F%2F5xM%3D","line":24,"in_reply_to":"AAAASn%2F%2F590%3D","updated":"2013-08-28 07:15:50.000000000","message":"Done","commit_id":"3603b1f22617b2448cf18ffbde93417a53f0a8ef"}],"nova/compute/plugins/libvirt_cpu_monitor_plugin.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"121113a6373b420c286c79eb2607054d1e88af06","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            uri \u003d CONF.libvirt_uri or \u0027lxc:///\u0027"},{"line_number":62,"context_line":"        else:"},{"line_number":63,"context_line":"            uri \u003d CONF.libvirt_uri or \u0027qemu:///system\u0027"},{"line_number":64,"context_line":"        return uri"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def get_metric_names(self):"},{"line_number":67,"context_line":"        return [\"cpu.frequency\","}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FR%2Bk%3D","line":64,"updated":"2013-07-05 09:32:01.000000000","message":"This duplication of code wrt the libvirt driver is bad. There are already patches pending for the libvirt driver which will break this in some ways, by supporting new way of specifying the URI. In addition using the openReadOnly method lacks the ability to authenticate with libvirt, as the main driver does. \n\nIMHO this plugin should not actually be opening a new connection at all, it should just obtain the handle to the existing connection the libvirt driver has open.","commit_id":"5c6867a8057cb9c6adae728bbc04ea94fc6d300f"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"4b364c313f1161c1bc079b7495c4924ec569f9db","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            uri \u003d CONF.libvirt_uri or \u0027lxc:///\u0027"},{"line_number":62,"context_line":"        else:"},{"line_number":63,"context_line":"            uri \u003d CONF.libvirt_uri or \u0027qemu:///system\u0027"},{"line_number":64,"context_line":"        return uri"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def get_metric_names(self):"},{"line_number":67,"context_line":"        return [\"cpu.frequency\","}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F2yQ%3D","line":64,"in_reply_to":"AAAAPn%2F%2FR%2Bk%3D","updated":"2013-07-10 10:50:22.000000000","message":"Done","commit_id":"5c6867a8057cb9c6adae728bbc04ea94fc6d300f"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"8ee249ef270bb28c56a41f33f3ed5cbc60428c21","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from nova import utils"},{"line_number":26,"context_line":"from nova.virt.libvirt import driver as libvirt_driver"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"libvirt \u003d None"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzXw%3D","line":28,"updated":"2013-07-11 07:43:47.000000000","message":"No longer necessary or used","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"92d67faa02d8201f9a79c6a6471843683ff0234a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from nova import utils"},{"line_number":26,"context_line":"from nova.virt.libvirt import driver as libvirt_driver"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"libvirt \u003d None"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzBY%3D","line":28,"in_reply_to":"AAAAP3%2F%2FzXw%3D","updated":"2013-07-11 09:12:09.000000000","message":"See later where the code does  libvirt.VIR_NODE_CPU_STATS_ALL_CPUS","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"8ee249ef270bb28c56a41f33f3ed5cbc60428c21","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        try:"},{"line_number":41,"context_line":"            driver \u003d utils.check_isinstance(self.compute_manager.driver,"},{"line_number":42,"context_line":"                                            libvirt_driver.LibvirtDriver)"},{"line_number":43,"context_line":"            global libvirt"},{"line_number":44,"context_line":"            if libvirt is None:"},{"line_number":45,"context_line":"                libvirt \u003d __import__(\u0027libvirt\u0027)"},{"line_number":46,"context_line":"        except Exception as ex:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzXs%3D","line":43,"updated":"2013-07-11 07:43:47.000000000","message":"see earlier libvirt comment for next few references","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"8ee249ef270bb28c56a41f33f3ed5cbc60428c21","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":48,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":49,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":50,"context_line":"        self._conn \u003d driver._conn"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def get_metric_names(self):"},{"line_number":53,"context_line":"        return [\"cpu.frequency\","}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzXA%3D","line":50,"updated":"2013-07-11 07:43:47.000000000","message":"Is there any possibility that driver._conn may not have been initialized when this is invoked .. that is could there be a race condition where we attempt to instantiate monitor plugin before driver?","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"feab076fdbf3a169d21007dce3a98704836decda","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":48,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":49,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":50,"context_line":"        self._conn \u003d driver._conn"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def get_metric_names(self):"},{"line_number":53,"context_line":"        return [\"cpu.frequency\","}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FyVM%3D","line":50,"in_reply_to":"AAAAP3%2F%2FzXA%3D","updated":"2013-07-11 14:55:44.000000000","message":"impossible? Because driver._conn is created in driver\u0027s __init__(), when compute manager loads the driver, its constructor is called.","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"8ee249ef270bb28c56a41f33f3ed5cbc60428c21","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        data.append(self._populate(\"cpu.iowait.time\", stats[\"iowait\"]))"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Compute the utilization percentages for each specific CPU time."},{"line_number":79,"context_line":"        perc \u003d (stats[\"user\"] - self._cpu_stats.get(\"user\", 0)) \\"},{"line_number":80,"context_line":"            / float(sum(stats.values()) - sum(self._cpu_stats.values()))"},{"line_number":81,"context_line":"        data.append(self._populate(\"cpu.user.percent\", perc))"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzVc%3D","line":79,"updated":"2013-07-11 07:43:47.000000000","message":"Puzzled ..  what is in self._cpu_stats.get(\"user\"). Why are we subtracting?  Please add more comments to explain.","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"92d67faa02d8201f9a79c6a6471843683ff0234a","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        data.append(self._populate(\"cpu.iowait.time\", stats[\"iowait\"]))"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Compute the utilization percentages for each specific CPU time."},{"line_number":79,"context_line":"        perc \u003d (stats[\"user\"] - self._cpu_stats.get(\"user\", 0)) \\"},{"line_number":80,"context_line":"            / float(sum(stats.values()) - sum(self._cpu_stats.values()))"},{"line_number":81,"context_line":"        data.append(self._populate(\"cpu.user.percent\", perc))"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzA0%3D","line":79,"in_reply_to":"AAAAP3%2F%2FzVc%3D","updated":"2013-07-11 09:12:09.000000000","message":"Libvirt returns absolute values for CPU time. This is calculating the delta between the current reading \u0026 the previous reading.","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"8ee249ef270bb28c56a41f33f3ed5cbc60428c21","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Compute the utilization percentages for each specific CPU time."},{"line_number":79,"context_line":"        perc \u003d (stats[\"user\"] - self._cpu_stats.get(\"user\", 0)) \\"},{"line_number":80,"context_line":"            / float(sum(stats.values()) - sum(self._cpu_stats.values()))"},{"line_number":81,"context_line":"        data.append(self._populate(\"cpu.user.percent\", perc))"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        perc \u003d (stats[\"kernel\"] - self._cpu_stats.get(\"kernel\", 0)) \\"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FzWo%3D","line":80,"updated":"2013-07-11 07:43:47.000000000","message":"float(sum(stats.values()) - sum(self._cpu_stats.values()))  is a common denominator in several of the computations below .. compute once and re-use?","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"feab076fdbf3a169d21007dce3a98704836decda","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Compute the utilization percentages for each specific CPU time."},{"line_number":79,"context_line":"        perc \u003d (stats[\"user\"] - self._cpu_stats.get(\"user\", 0)) \\"},{"line_number":80,"context_line":"            / float(sum(stats.values()) - sum(self._cpu_stats.values()))"},{"line_number":81,"context_line":"        data.append(self._populate(\"cpu.user.percent\", perc))"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        perc \u003d (stats[\"kernel\"] - self._cpu_stats.get(\"kernel\", 0)) \\"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2FyOg%3D","line":80,"in_reply_to":"AAAAP3%2F%2FzWo%3D","updated":"2013-07-11 14:55:44.000000000","message":"Done","commit_id":"ba2f8f5241d491ef75a84fddaa66fa5316350e68"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"c159004695243d26d321749911028b0e536c32e0","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            # Get libvirt connection from compute manager"},{"line_number":52,"context_line":"            driver \u003d utils.check_isinstance(self.compute_manager.driver,"},{"line_number":53,"context_line":"                                            libvirt_driver.LibvirtDriver)"},{"line_number":54,"context_line":"            global libvirt"},{"line_number":55,"context_line":"            if libvirt is None:"},{"line_number":56,"context_line":"                libvirt \u003d __import__(\u0027libvirt\u0027)"},{"line_number":57,"context_line":"        except Exception as ex:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2Fxn0%3D","line":54,"updated":"2013-07-11 16:37:48.000000000","message":"Do we need this libvirt variable given you are accessing driver directly? If yes, then there are two possible exceptions, do you need to treat them differently in the try catch block?","commit_id":"8957b8d190a2c312a27fa7379734522dccf19e75"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"cda65213067f97ff8de607a6578b7469a5d40440","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            # Get libvirt connection from compute manager"},{"line_number":52,"context_line":"            driver \u003d utils.check_isinstance(self.compute_manager.driver,"},{"line_number":53,"context_line":"                                            libvirt_driver.LibvirtDriver)"},{"line_number":54,"context_line":"            global libvirt"},{"line_number":55,"context_line":"            if libvirt is None:"},{"line_number":56,"context_line":"                libvirt \u003d __import__(\u0027libvirt\u0027)"},{"line_number":57,"context_line":"        except Exception as ex:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2FxlI%3D","line":54,"in_reply_to":"AAAAP3%2F%2Fxn0%3D","updated":"2013-07-11 16:43:02.000000000","message":"There is later code, which references the \u0027libvirt\u0027 module:\n\nLine 83:        stats \u003d self._conn.getCPUStats(libvirt.VIR_NODE_CPU_STATS_ALL_CPUS, 0)\n\nthis requires that we setup the libvirt module import","commit_id":"8957b8d190a2c312a27fa7379734522dccf19e75"},{"author":{"_account_id":4992,"name":"malini-k-bhandaru","email":"malini.k.bhandaru@intel.com","username":"malini-k-bhandaru"},"change_message_id":"db281bc5765e2db19cc5090e0124777e45e5ec4a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            driver \u003d utils.check_isinstance(self.compute_manager.driver,"},{"line_number":53,"context_line":"                                            libvirt_driver.LibvirtDriver)"},{"line_number":54,"context_line":"            global libvirt"},{"line_number":55,"context_line":"            if libvirt is None:"},{"line_number":56,"context_line":"                libvirt \u003d __import__(\u0027libvirt\u0027)"},{"line_number":57,"context_line":"        except Exception as ex:"},{"line_number":58,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2Fwl4%3D","line":55,"updated":"2013-07-11 21:00:48.000000000","message":"Thank you Daniel! I missed that reference. \nDo we want to differentiate between exceptions from getting driver to importing libvirt. This is minor nit.","commit_id":"8957b8d190a2c312a27fa7379734522dccf19e75"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d0dea9ed54bb6a49c78dd120e9520b774b71edf2","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2013 Intel Corporation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FuPQ%3D","line":1,"updated":"2013-07-12 13:00:56.000000000","message":"Thinking out loud here - would it not be better that this was under the virt directory? It would be a bit cleaner. What do you think?","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9e5b35ee763510cd65d4bbc43fcac3fe8690e5ee","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2013 Intel Corporation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FqTc%3D","line":1,"in_reply_to":"AAAAP3%2F%2FuPQ%3D","updated":"2013-07-15 03:21:27.000000000","message":"No I think it is not a good idea. See my reply. What do you think?","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d0dea9ed54bb6a49c78dd120e9520b774b71edf2","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            global libvirt"},{"line_number":55,"context_line":"            if libvirt is None:"},{"line_number":56,"context_line":"                libvirt \u003d __import__(\u0027libvirt\u0027)"},{"line_number":57,"context_line":"        except Exception as ex:"},{"line_number":58,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":59,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":60,"context_line":"                plugin\u003dself.__class__.__name__)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FuPM%3D","line":57,"updated":"2013-07-12 13:00:56.000000000","message":"I think that this accentuates the comments above.","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9e5b35ee763510cd65d4bbc43fcac3fe8690e5ee","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            global libvirt"},{"line_number":55,"context_line":"            if libvirt is None:"},{"line_number":56,"context_line":"                libvirt \u003d __import__(\u0027libvirt\u0027)"},{"line_number":57,"context_line":"        except Exception as ex:"},{"line_number":58,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":59,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":60,"context_line":"                plugin\u003dself.__class__.__name__)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FqTU%3D","line":57,"in_reply_to":"AAAAP3%2F%2FuPM%3D","updated":"2013-07-15 03:21:27.000000000","message":"Done","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"c59675f98a7dedafda060f10f180ee0414a26259","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def get_user_time(self, **kwargs):"},{"line_number":72,"context_line":"        self._update_cpustat()"},{"line_number":73,"context_line":"        return self._data.get(\"cpu.user.time\"),\\"},{"line_number":74,"context_line":"               self._data.get(\"timestamp\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_kernel_time(self, **kwargs):"},{"line_number":77,"context_line":"        self._update_cpustat()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAQn%2F%2FqZo%3D","line":74,"updated":"2013-07-25 15:11:16.000000000","message":"How about a decorator which returns self._data.get(\u0027timestamp\u0027) as the second return value?","commit_id":"bef9da04b39a62b1416bcf3df673329bf22d2f80"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"557dc1c0747508a43e8d20eba07b621ca1d6d029","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def get_user_time(self, **kwargs):"},{"line_number":72,"context_line":"        self._update_cpustat()"},{"line_number":73,"context_line":"        return self._data.get(\"cpu.user.time\"),\\"},{"line_number":74,"context_line":"               self._data.get(\"timestamp\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_kernel_time(self, **kwargs):"},{"line_number":77,"context_line":"        self._update_cpustat()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAQ3%2F%2F4x8%3D","line":74,"in_reply_to":"AAAAQn%2F%2FqZo%3D","updated":"2013-08-15 06:43:03.000000000","message":"Good idea, I will change in the next patchset.","commit_id":"bef9da04b39a62b1416bcf3df673329bf22d2f80"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0643a7d985ac74917cdec845f77003e3f31cdd45","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from nova import utils"},{"line_number":26,"context_line":"from nova.virt.libvirt import driver as libvirt_driver"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"libvirt \u003d None"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAQn%2F%2FlXQ%3D","line":28,"updated":"2013-07-27 07:43:57.000000000","message":"i am a little confused here - why is libvirt none and we are including drivers from nova.virt.libvirt\n\ni would prefer that this code reside under the virt driver directory.\nit is cleaner and more coherent.\nyou can have a directory nova/virt/libvirt/plugins/","commit_id":"cc42d90eabfcad495bb3a0f14de90f8e4000cd83"}],"nova/compute/plugins/virt/cpu_monitor_plugin.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"353e874f85ef19e0ad7ab7f268119339c76beb2b","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":123,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # Libvirt returns the absolute values for CPU times. We compute the"},{"line_number":126,"context_line":"        # utilization percentages for each specific CPU time after calculating"},{"line_number":127,"context_line":"        # the delta between the current reading and the previous reading."},{"line_number":128,"context_line":"        cputime \u003d float(stats[\"total\"] - self._cpu_stats.get(\"total\", 0))"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F6gA%3D","line":125,"updated":"2013-08-15 09:55:09.000000000","message":"s/Libvirt returns/The compute driver API returns/","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"2605372e0b16d4b5078433e21c06da405beffef1","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":123,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # Libvirt returns the absolute values for CPU times. We compute the"},{"line_number":126,"context_line":"        # utilization percentages for each specific CPU time after calculating"},{"line_number":127,"context_line":"        # the delta between the current reading and the previous reading."},{"line_number":128,"context_line":"        cputime \u003d float(stats[\"total\"] - self._cpu_stats.get(\"total\", 0))"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F3hk%3D","line":125,"in_reply_to":"AAAARH%2F%2F6gA%3D","updated":"2013-08-16 05:14:23.000000000","message":"Sorry for missing that. Done","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"}],"nova/compute/plugins/virt/libvirt/cpu_monitor_plugin.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"c22fa4567de56bd9a6d9503b237e73c3392745e9","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":63,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":64,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":65,"context_line":"        self._conn \u003d driver._conn"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":68,"context_line":"        # getInfo() returns various information about the host node."}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAQ3%2F%2F5a4%3D","line":65,"updated":"2013-08-13 09:52:56.000000000","message":"I\u0027m wondering if this design is the really the right way to deal with interactions between the plugin and the computer driver layer.\n\nAt it is done here, there\u0027s really no connection between the two layers, so this plugin is completely libvirt specific, and will have to be implemented again for different compute drivers. This doesn\u0027t seem like a particularly good idea.\n\nI think perhaps the design would better if we had the ComputeDriver API in nova/virt/driver.py expose a method \"get_host_cpu_stats\", which would then be implemented by each compute driver.\n\nThen, this plugin could simply call into the standard compute driver API, ,thus we could name it HostCPUMonitorPlugin.  That way all the libvirt specific code is still isolated in the libvirt compute driver, and not polluting this plugin code.","commit_id":"a7b99c7c164caa7067651bde997908db931640fe"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"aa0b1b7896d156255b45fa06eafa2303966d2cb6","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":63,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":64,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":65,"context_line":"        self._conn \u003d driver._conn"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":68,"context_line":"        # getInfo() returns various information about the host node."}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAARH%2F%2F%2Fvg%3D","line":65,"in_reply_to":"AAAAQ3%2F%2F4x4%3D","updated":"2013-08-14 01:36:58.000000000","message":"I got you, Daniel, let me think about how to do. thanks.","commit_id":"a7b99c7c164caa7067651bde997908db931640fe"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"42fd8f3b993e3d3abf0b033a5897cc5888dae647","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":63,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":64,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":65,"context_line":"        self._conn \u003d driver._conn"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":68,"context_line":"        # getInfo() returns various information about the host node."}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAQ3%2F%2F4x4%3D","line":65,"in_reply_to":"AAAAQ3%2F%2F4zc%3D","updated":"2013-08-13 13:44:45.000000000","message":"I\u0027m not saying that all plugins should be implemented by a compute driver. I\u0027m saying that this particular plugin should be delegating to a formal API exposed by the compute drivers, so that all libvirt logic is isolated in one place \u0026 other compute drivers can expose the same info for this particular plugin.  It is fine if other  future plugins callout out to non-compute driver data sources.","commit_id":"a7b99c7c164caa7067651bde997908db931640fe"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"ba302ffb8307744de4f096984f576e5884e9d252","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            LOG.exception(_(\"Libvirt is not used by compute manager: %s\"), ex)"},{"line_number":63,"context_line":"            raise exception.ResourceMonitorPluginError("},{"line_number":64,"context_line":"                plugin\u003dself.__class__.__name__)"},{"line_number":65,"context_line":"        self._conn \u003d driver._conn"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def get_frequency(self, **kwargs):"},{"line_number":68,"context_line":"        # getInfo() returns various information about the host node."}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAQ3%2F%2F4zc%3D","line":65,"in_reply_to":"AAAAQ3%2F%2F5a4%3D","updated":"2013-08-13 13:40:21.000000000","message":"Hi Daniel,\n\nWhat we are thinking is a plugin is optional for nova. It might be useful for nova scheduler to get more information about the compute node. And it is also OK if the scheduler can\u0027t get that information. It is not decided that all plugins should be implemented by a compute driver. Here I just gave an example to use libvirt to retrieve the information of CPU (probably I gave a wrong example to make you confused:-).\n\nWhat I want to tell it, that is a kind of framework to support plugins and also software providers or hardware providers can implement their own plugins to retrieve the information on software/hardware they provided. For example, Intelligent Platform Management Interface (IPMI) protocol can be used to  retrieve the information of the chipset and the power. For example, a lib psutils is used to get information about the current network traffic and bandwidth.\n\nLater on, garyk and Sean Dague suggested me to make an abstract layer and put this file into a directory related to libvirt. But I want to say plugins are not designed to be callers to compute drivers. And that is only an example and default implementation for CPU monitoring.","commit_id":"a7b99c7c164caa7067651bde997908db931640fe"}],"nova/tests/compute/monitors/test_cpu_monitor.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from nova.compute import manager"},{"line_number":24,"context_line":"from nova.compute.monitors.virt import ComputeDriverCPUMonitor"},{"line_number":25,"context_line":"from nova import test"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiXc%3D","line":24,"updated":"2013-09-03 18:29:01.000000000","message":"Again, feels like a single flat package would be good enough.  \n\n(Most test cases test code in the same package.)","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from nova.compute import manager"},{"line_number":24,"context_line":"from nova.compute.monitors.virt import ComputeDriverCPUMonitor"},{"line_number":25,"context_line":"from nova import test"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fctc%3D","line":24,"in_reply_to":"AAAASn%2F%2FiXc%3D","updated":"2013-09-05 06:44:51.000000000","message":"Done","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d23ea016f22152a40641436c6f8edce62d6eb8c9","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class ComputeDriverCPUMonitorTestCase(test.TestCase):"},{"line_number":29,"context_line":"    def set_fakelibvirt(self):"},{"line_number":30,"context_line":"        import nova.tests.virt.libvirt.fakelibvirt as fakelibvirt"},{"line_number":31,"context_line":"        sys.modules[\u0027libvirt\u0027] \u003d fakelibvirt"},{"line_number":32,"context_line":"        self.useFixture(fixtures.MonkeyPatch("},{"line_number":33,"context_line":"            \u0027nova.virt.libvirt.driver.libvirt\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FiR8%3D","line":30,"updated":"2013-09-03 18:29:01.000000000","message":"Test cases should probably be libvirt agnostic.  I don\u0027t see much usage of libvirt-specific code outside of nova.tests.virt.\n\n(I suspect you can use a much more limited mock driver for your purposes to eliminate the dependency.)","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class ComputeDriverCPUMonitorTestCase(test.TestCase):"},{"line_number":29,"context_line":"    def set_fakelibvirt(self):"},{"line_number":30,"context_line":"        import nova.tests.virt.libvirt.fakelibvirt as fakelibvirt"},{"line_number":31,"context_line":"        sys.modules[\u0027libvirt\u0027] \u003d fakelibvirt"},{"line_number":32,"context_line":"        self.useFixture(fixtures.MonkeyPatch("},{"line_number":33,"context_line":"            \u0027nova.virt.libvirt.driver.libvirt\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FZ%2Fw%3D","line":30,"in_reply_to":"AAAASn%2F%2FiR8%3D","updated":"2013-09-05 06:44:51.000000000","message":"Done","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def setUp(self):"},{"line_number":41,"context_line":"        super(ComputeDriverCPUMonitorTestCase, self).setUp()"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        import nova.virt.libvirt.driver"},{"line_number":44,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.libvirt.LibvirtDriver\u0027)"},{"line_number":45,"context_line":"        self.stubs.Set(nova.virt.libvirt.driver.LibvirtDriver,"},{"line_number":46,"context_line":"                       \u0027_conn\u0027, FakeLibvirt())"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FINQ%3D","line":43,"updated":"2013-10-22 19:33:22.000000000","message":"Is there a reason this import is not in the block of imports at the top of this file?  We generally only want to see inner imports if they would cause an import loop, and it\u0027s a foregone conclusion that neither nova.virt.libvirt.driver nor any of its dependencies will ever include a test file.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def setUp(self):"},{"line_number":41,"context_line":"        super(ComputeDriverCPUMonitorTestCase, self).setUp()"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        import nova.virt.libvirt.driver"},{"line_number":44,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.libvirt.LibvirtDriver\u0027)"},{"line_number":45,"context_line":"        self.stubs.Set(nova.virt.libvirt.driver.LibvirtDriver,"},{"line_number":46,"context_line":"                       \u0027_conn\u0027, FakeLibvirt())"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDW4%3D","line":43,"in_reply_to":"AAAATH%2F%2FINQ%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        import nova.virt.libvirt.driver"},{"line_number":44,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.libvirt.LibvirtDriver\u0027)"},{"line_number":45,"context_line":"        self.stubs.Set(nova.virt.libvirt.driver.LibvirtDriver,"},{"line_number":46,"context_line":"                       \u0027_conn\u0027, FakeLibvirt())"},{"line_number":47,"context_line":"        cm \u003d manager.ComputeManager()"},{"line_number":48,"context_line":"        self.monitor \u003d virt.ComputeDriverCPUMonitor(cm)"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FINE%3D","line":46,"updated":"2013-10-22 19:33:22.000000000","message":"We are discouraging the use of mox artifacts like stubs.  While I won\u0027t -1 based on this, you should consider using the mock library or using fixtures.MonkeyPatch","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        import nova.virt.libvirt.driver"},{"line_number":44,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.libvirt.LibvirtDriver\u0027)"},{"line_number":45,"context_line":"        self.stubs.Set(nova.virt.libvirt.driver.LibvirtDriver,"},{"line_number":46,"context_line":"                       \u0027_conn\u0027, FakeLibvirt())"},{"line_number":47,"context_line":"        cm \u003d manager.ComputeManager()"},{"line_number":48,"context_line":"        self.monitor \u003d virt.ComputeDriverCPUMonitor(cm)"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDFo%3D","line":46,"in_reply_to":"AAAATH%2F%2FINE%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"}],"nova/tests/compute/monitors/test_monitors.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class FakeResourceMonitor(monitors.ResourceMonitorBase):"},{"line_number":25,"context_line":"    def __init__(self, parent):"},{"line_number":26,"context_line":"        super(FakeResourceMonitor, self).__init__(parent)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def get_metric_names(self):"},{"line_number":29,"context_line":"        return [\"foo.metric1\", \"foo.metric2\"]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FINA%3D","line":26,"updated":"2013-10-22 19:33:22.000000000","message":"Unneeded \"__init__()\" method.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class FakeResourceMonitor(monitors.ResourceMonitorBase):"},{"line_number":25,"context_line":"    def __init__(self, parent):"},{"line_number":26,"context_line":"        super(FakeResourceMonitor, self).__init__(parent)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def get_metric_names(self):"},{"line_number":29,"context_line":"        return [\"foo.metric1\", \"foo.metric2\"]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDWY%3D","line":26,"in_reply_to":"AAAATH%2F%2FINA%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"}],"nova/tests/compute/test_cpu_plugin.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"353e874f85ef19e0ad7ab7f268119339c76beb2b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.set_fakelibvirt()"},{"line_number":39,"context_line":"        plugin_provider \u003d \"nova.compute.plugins.virt\" \\"},{"line_number":40,"context_line":"            \".ComputeDriverCPUMonitorPlugin\""},{"line_number":41,"context_line":"        plugin_klass \u003d importutils.import_class(plugin_provider)"},{"line_number":42,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.libvirt.LibvirtDriver\u0027)"},{"line_number":43,"context_line":"        cm \u003d manager.ComputeManager()"},{"line_number":44,"context_line":"        self.plugin \u003d plugin_klass(cm)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F6es%3D","line":41,"updated":"2013-08-15 09:55:09.000000000","message":"Why are you doing this, instead of just using \u0027import nova.compute.plugins.virt.ComputerDriverCPUMonitorPlugin\u0027 at the start of the file","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"2605372e0b16d4b5078433e21c06da405beffef1","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.set_fakelibvirt()"},{"line_number":39,"context_line":"        plugin_provider \u003d \"nova.compute.plugins.virt\" \\"},{"line_number":40,"context_line":"            \".ComputeDriverCPUMonitorPlugin\""},{"line_number":41,"context_line":"        plugin_klass \u003d importutils.import_class(plugin_provider)"},{"line_number":42,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.libvirt.LibvirtDriver\u0027)"},{"line_number":43,"context_line":"        cm \u003d manager.ComputeManager()"},{"line_number":44,"context_line":"        self.plugin \u003d plugin_klass(cm)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F3g4%3D","line":41,"in_reply_to":"AAAARH%2F%2F6es%3D","updated":"2013-08-16 05:14:23.000000000","message":"I thought https://review.openstack.org/#/c/35767/ was using this approach to load plugins. So in order to test that approach works.... OK, I change that as you said. Done.","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"}],"nova/tests/compute/test_libvirt_cpu_plugin.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d2bb38cfd74bd0b8025e7997475e7ce2e61b5646","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class LibvirtCPUMonitorPluginTestCase(test.TestCase):"},{"line_number":29,"context_line":"    def set_fakelibvirt(self):"},{"line_number":30,"context_line":"        import nova.tests.virt.libvirt.fakelibvirt as fakelibvirt"},{"line_number":31,"context_line":"        sys.modules[\u0027libvirt\u0027] \u003d fakelibvirt"},{"line_number":32,"context_line":"        self.useFixture(fixtures.MonkeyPatch("},{"line_number":33,"context_line":"            \u0027nova.virt.libvirt.driver.libvirt\u0027,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAQn%2F%2FOew%3D","line":30,"updated":"2013-08-05 06:37:44.000000000","message":"why is this not with the main set of imports?","commit_id":"0380701bf43b8c6f7c10b8bfaa353f6096e2745a"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"4643a7a7f8c1da2bff3165e507175c916da77d51","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class LibvirtCPUMonitorPluginTestCase(test.TestCase):"},{"line_number":29,"context_line":"    def set_fakelibvirt(self):"},{"line_number":30,"context_line":"        import nova.tests.virt.libvirt.fakelibvirt as fakelibvirt"},{"line_number":31,"context_line":"        sys.modules[\u0027libvirt\u0027] \u003d fakelibvirt"},{"line_number":32,"context_line":"        self.useFixture(fixtures.MonkeyPatch("},{"line_number":33,"context_line":"            \u0027nova.virt.libvirt.driver.libvirt\u0027,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAQn%2F%2FORM%3D","line":30,"in_reply_to":"AAAAQn%2F%2FOew%3D","updated":"2013-08-05 08:33:07.000000000","message":"I studied the style from _setup_fakelibvirt() in class _FakeDriverBackendTestCase in nova/tests/virt/test_virt_drivers.py.\n\nShould I?","commit_id":"0380701bf43b8c6f7c10b8bfaa353f6096e2745a"}],"nova/tests/compute/test_plugins.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d0dea9ed54bb6a49c78dd120e9520b774b71edf2","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        pass"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def get_metric_names(self):"},{"line_number":34,"context_line":"        return [\"foo.metric1\","},{"line_number":35,"context_line":"            \"foo.metric2\"]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def get_metrics(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FuPA%3D","line":34,"updated":"2013-07-12 13:00:56.000000000","message":"nit - why not on the same line?","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9e5b35ee763510cd65d4bbc43fcac3fe8690e5ee","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        pass"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def get_metric_names(self):"},{"line_number":34,"context_line":"        return [\"foo.metric1\","},{"line_number":35,"context_line":"            \"foo.metric2\"]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def get_metrics(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FqTQ%3D","line":34,"in_reply_to":"AAAAP3%2F%2FuPA%3D","updated":"2013-07-15 03:21:27.000000000","message":"Done","commit_id":"d23dc4bdb2a1a527b1d15a71c1eed5d02ebfb1a6"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"6684f62cb541119fe8c2720512a8781d5fa1ce07","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.assertEquals(metrics[\"foo.metric2\"], \u002799.999\u0027)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"class LibvirtCPUMonitorPluginTestCase(test.TestCase):"},{"line_number":71,"context_line":"    def set_fakelibvirt(self):"},{"line_number":72,"context_line":"        import nova.tests.virt.libvirt.fakelibvirt as fakelibvirt"},{"line_number":73,"context_line":"        sys.modules[\u0027libvirt\u0027] \u003d fakelibvirt"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2FgTs%3D","line":70,"updated":"2013-07-17 08:45:21.000000000","message":"As plugins are likely to be hypervisor specific I think tests for a specific plugin should be split out into a separate file.\n\nI worry about the precedent of having a whole bunch of unrelated plugins being maintained in a single file","commit_id":"a834d1e1b659e83ebb1921649f2838a19d716f3b"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"353e874f85ef19e0ad7ab7f268119339c76beb2b","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        plugin_provider \u003d \"nova.tests.compute.test_plugins\" \\"},{"line_number":44,"context_line":"            \".FakeResourceMonitorPlugin\""},{"line_number":45,"context_line":"        plugin_klass \u003d importutils.import_class(plugin_provider)"},{"line_number":46,"context_line":"        self.plugin \u003d plugin_klass(None)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def test_get_metric_names(self):"},{"line_number":49,"context_line":"        names \u003d self.plugin.get_metric_names()"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F6eE%3D","line":46,"updated":"2013-08-15 09:55:09.000000000","message":"This class is defined in this very file. Cant you just do  \"self.plugin \u003d FakeResourceMonitorPlugin(None)\"","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"2605372e0b16d4b5078433e21c06da405beffef1","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        plugin_provider \u003d \"nova.tests.compute.test_plugins\" \\"},{"line_number":44,"context_line":"            \".FakeResourceMonitorPlugin\""},{"line_number":45,"context_line":"        plugin_klass \u003d importutils.import_class(plugin_provider)"},{"line_number":46,"context_line":"        self.plugin \u003d plugin_klass(None)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def test_get_metric_names(self):"},{"line_number":49,"context_line":"        names \u003d self.plugin.get_metric_names()"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F3bA%3D","line":46,"in_reply_to":"AAAARH%2F%2F6eE%3D","updated":"2013-08-16 05:14:23.000000000","message":"Done","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"}],"nova/tests/virt/libvirt/fakelibvirt.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0643a7d985ac74917cdec845f77003e3f31cdd45","unresolved":false,"context_lines":[{"line_number":894,"context_line":"                    \u0027user\u0027: 26728850000000L,"},{"line_number":895,"context_line":"                    \u0027iowait\u0027: 6121490000000L}"},{"line_number":896,"context_line":"        else:"},{"line_number":897,"context_line":"            raise libvirtError(\"invalid argument: Invalid cpu number\")"},{"line_number":898,"context_line":""},{"line_number":899,"context_line":""},{"line_number":900,"context_line":"def openReadOnly(uri):"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAQn%2F%2FlXU%3D","line":897,"updated":"2013-07-27 07:43:57.000000000","message":"i18n support (but I guess that this is for the tests so it is ok.","commit_id":"cc42d90eabfcad495bb3a0f14de90f8e4000cd83"}],"nova/virt/driver.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"353e874f85ef19e0ad7ab7f268119339c76beb2b","unresolved":false,"context_lines":[{"line_number":790,"context_line":"        \"\"\"Return currently known host stats.\"\"\""},{"line_number":791,"context_line":"        raise NotImplementedError()"},{"line_number":792,"context_line":""},{"line_number":793,"context_line":"    def get_host_cpu_stats(self, refresh\u003dFalse):"},{"line_number":794,"context_line":"        \"\"\"Return currently known host CPU stats.\"\"\""},{"line_number":795,"context_line":"        raise NotImplementedError()"},{"line_number":796,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F6g8%3D","line":793,"updated":"2013-08-15 09:55:09.000000000","message":"I know the existing methods here suck in terms of their documentation, but that\u0027s not good practice to follow. Please add python docs here describing the semantics of the API parameters and most importantly the format for the data to be returned.","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"2605372e0b16d4b5078433e21c06da405beffef1","unresolved":false,"context_lines":[{"line_number":790,"context_line":"        \"\"\"Return currently known host stats.\"\"\""},{"line_number":791,"context_line":"        raise NotImplementedError()"},{"line_number":792,"context_line":""},{"line_number":793,"context_line":"    def get_host_cpu_stats(self, refresh\u003dFalse):"},{"line_number":794,"context_line":"        \"\"\"Return currently known host CPU stats.\"\"\""},{"line_number":795,"context_line":"        raise NotImplementedError()"},{"line_number":796,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F3Rk%3D","line":793,"in_reply_to":"AAAARH%2F%2F6g8%3D","updated":"2013-08-16 05:14:23.000000000","message":"Done","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"c33a0e33b1b5644ebc06255da8755bae2e94e04c","unresolved":false,"context_lines":[{"line_number":801,"context_line":"        \"\"\""},{"line_number":802,"context_line":"        raise NotImplementedError()"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    def get_host_cpu_stats(self):"},{"line_number":805,"context_line":"        \"\"\""},{"line_number":806,"context_line":"        Return currently known host CPU stats."},{"line_number":807,"context_line":"        These are returned as {\u0027kernel\u0027: kern, \u0027idle\u0027: idle, \u0027user\u0027: user,"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2Fblg%3D","line":804,"updated":"2013-09-04 20:19:28.000000000","message":"I don\u0027t like the idea of adding an interface to nova/virt/driver that is only implemented by one driver (libvirt).\n\nAnd the very least the commit message should make it clear that this is only implemented here, and open bugs for other virt drivers etc.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"f7ed67bb187f28da9fdfd3a87898a4bf184cbee2","unresolved":false,"context_lines":[{"line_number":801,"context_line":"        \"\"\""},{"line_number":802,"context_line":"        raise NotImplementedError()"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    def get_host_cpu_stats(self):"},{"line_number":805,"context_line":"        \"\"\""},{"line_number":806,"context_line":"        Return currently known host CPU stats."},{"line_number":807,"context_line":"        These are returned as {\u0027kernel\u0027: kern, \u0027idle\u0027: idle, \u0027user\u0027: user,"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAASn%2F%2FaN4%3D","line":804,"in_reply_to":"AAAASn%2F%2Fblg%3D","updated":"2013-09-05 06:44:51.000000000","message":"Hi Joe,\n\nDaniel Berrange suggested me to add this api in virt driver and implement it in libvirt. OK, I will update the commit message and open a bug for other virt drivers.","commit_id":"b4c0ff8f2885fd7c3bc840adcbd3839b78197508"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"dc12637403f2c95c555ec9eb51e2c4db1472e07a","unresolved":false,"context_lines":[{"line_number":815,"context_line":"        Return currently known host CPU stats."},{"line_number":816,"context_line":"        These are returned as {\u0027kernel\u0027: kern, \u0027idle\u0027: idle, \u0027user\u0027: user,"},{"line_number":817,"context_line":"        \u0027iowait\u0027: wait, \u0027frequency\u0027: freq}, where kern and user indicate"},{"line_number":818,"context_line":"        the cumulative CPU time (nanoseconds) which spends by kernel and"},{"line_number":819,"context_line":"        user processes respectively, idle indicates the cumulative idle CPU"},{"line_number":820,"context_line":"        time (nanoseconds), wait indicates the cumulative I/O wait CPU time"},{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2Fd%2Fg%3D","line":818,"updated":"2013-10-15 19:37:43.000000000","message":"s/which spends by kernel/spent by kernel/","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":815,"context_line":"        Return currently known host CPU stats."},{"line_number":816,"context_line":"        These are returned as {\u0027kernel\u0027: kern, \u0027idle\u0027: idle, \u0027user\u0027: user,"},{"line_number":817,"context_line":"        \u0027iowait\u0027: wait, \u0027frequency\u0027: freq}, where kern and user indicate"},{"line_number":818,"context_line":"        the cumulative CPU time (nanoseconds) which spends by kernel and"},{"line_number":819,"context_line":"        user processes respectively, idle indicates the cumulative idle CPU"},{"line_number":820,"context_line":"        time (nanoseconds), wait indicates the cumulative I/O wait CPU time"},{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDWE%3D","line":818,"in_reply_to":"AAAATH%2F%2Fd%2Fg%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"dc12637403f2c95c555ec9eb51e2c4db1472e07a","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        the cumulative CPU time (nanoseconds) which spends by kernel and"},{"line_number":819,"context_line":"        user processes respectively, idle indicates the cumulative idle CPU"},{"line_number":820,"context_line":"        time (nanoseconds), wait indicates the cumulative I/O wait CPU time"},{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"},{"line_number":822,"context_line":"        CPU frequency (MHz)."},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"        All values are long integers."}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2Fd%2FM%3D","line":821,"updated":"2013-10-15 19:37:43.000000000","message":"what do you mean here: \"when the host booting up\"?","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        the cumulative CPU time (nanoseconds) which spends by kernel and"},{"line_number":819,"context_line":"        user processes respectively, idle indicates the cumulative idle CPU"},{"line_number":820,"context_line":"        time (nanoseconds), wait indicates the cumulative I/O wait CPU time"},{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"},{"line_number":822,"context_line":"        CPU frequency (MHz)."},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"        All values are long integers."}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDTw%3D","line":821,"in_reply_to":"AAAATH%2F%2FIMg%3D","updated":"2013-11-15 08:36:38.000000000","message":":)","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        the cumulative CPU time (nanoseconds) which spends by kernel and"},{"line_number":819,"context_line":"        user processes respectively, idle indicates the cumulative idle CPU"},{"line_number":820,"context_line":"        time (nanoseconds), wait indicates the cumulative I/O wait CPU time"},{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"},{"line_number":822,"context_line":"        CPU frequency (MHz)."},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"        All values are long integers."}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDT8%3D","line":821,"in_reply_to":"AAAATH%2F%2Fd%2FM%3D","updated":"2013-11-15 08:36:38.000000000","message":"\"since the host booting up\" might be more precise.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f731a905da613410ec01331681c4c7c023f06432","unresolved":false,"context_lines":[{"line_number":818,"context_line":"        the cumulative CPU time (nanoseconds) which spends by kernel and"},{"line_number":819,"context_line":"        user processes respectively, idle indicates the cumulative idle CPU"},{"line_number":820,"context_line":"        time (nanoseconds), wait indicates the cumulative I/O wait CPU time"},{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"},{"line_number":822,"context_line":"        CPU frequency (MHz)."},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"        All values are long integers."}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2FIMg%3D","line":821,"in_reply_to":"AAAATH%2F%2Fd%2FM%3D","updated":"2013-10-22 19:33:22.000000000","message":"He probably means, \"while the host is booting up\"","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"dc12637403f2c95c555ec9eb51e2c4db1472e07a","unresolved":false,"context_lines":[{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"},{"line_number":822,"context_line":"        CPU frequency (MHz)."},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"        All values are long integers."},{"line_number":825,"context_line":"        \"\"\""},{"line_number":826,"context_line":"        raise NotImplementedError()"},{"line_number":827,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATH%2F%2Fd%2Bw%3D","line":824,"updated":"2013-10-15 19:37:43.000000000","message":"Can you break up the wall of text and use the sphinx documenting format:\n\nhttp://pythonhosted.org/an_example_pypi_project/sphinx.html#full-code-example\n\nThere are also many examples in the code.","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"9994f49a3fb4dd8ec059e1512ba02565606aaa4a","unresolved":false,"context_lines":[{"line_number":821,"context_line":"        (nanoseconds), when the host booting up; freq indicates the current"},{"line_number":822,"context_line":"        CPU frequency (MHz)."},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"        All values are long integers."},{"line_number":825,"context_line":"        \"\"\""},{"line_number":826,"context_line":"        raise NotImplementedError()"},{"line_number":827,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAATn%2F%2FDMY%3D","line":824,"in_reply_to":"AAAATH%2F%2Fd%2Bw%3D","updated":"2013-11-15 08:36:38.000000000","message":"Done","commit_id":"800190fc9fe99558fb83ec828c4cc6d38d4e8ecc"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"353e874f85ef19e0ad7ab7f268119339c76beb2b","unresolved":false,"context_lines":[{"line_number":3001,"context_line":"        \"\"\"Return the current CPU frequency.\"\"\""},{"line_number":3002,"context_line":"        # getInfo() returns various information about the host node."},{"line_number":3003,"context_line":"        # No. 3 is the expected CPU frequency."},{"line_number":3004,"context_line":"        return self._conn.getInfo()[3]"},{"line_number":3005,"context_line":""},{"line_number":3006,"context_line":"    def get_all_volume_usage(self, context, compute_host_bdms):"},{"line_number":3007,"context_line":"        \"\"\"Return usage info for volumes attached to vms on"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F6gk%3D","line":3004,"updated":"2013-08-15 09:55:09.000000000","message":"I don\u0027t really see the point in having this as a separate API - just call getInfo() fro get_host_cpu_stats directly.","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"2605372e0b16d4b5078433e21c06da405beffef1","unresolved":false,"context_lines":[{"line_number":3001,"context_line":"        \"\"\"Return the current CPU frequency.\"\"\""},{"line_number":3002,"context_line":"        # getInfo() returns various information about the host node."},{"line_number":3003,"context_line":"        # No. 3 is the expected CPU frequency."},{"line_number":3004,"context_line":"        return self._conn.getInfo()[3]"},{"line_number":3005,"context_line":""},{"line_number":3006,"context_line":"    def get_all_volume_usage(self, context, compute_host_bdms):"},{"line_number":3007,"context_line":"        \"\"\"Return usage info for volumes attached to vms on"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F3Rw%3D","line":3004,"in_reply_to":"AAAARH%2F%2F6gk%3D","updated":"2013-08-16 05:14:23.000000000","message":"Done","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"353e874f85ef19e0ad7ab7f268119339c76beb2b","unresolved":false,"context_lines":[{"line_number":3763,"context_line":"        \"\"\"Return the current CPU state of the host.\"\"\""},{"line_number":3764,"context_line":"        # Extract node\u0027s CPU statistics."},{"line_number":3765,"context_line":"        stats \u003d self._conn.getCPUStats(libvirt.VIR_NODE_CPU_STATS_ALL_CPUS, 0)"},{"line_number":3766,"context_line":"        stats[\"total\"] \u003d sum(stats.values())"},{"line_number":3767,"context_line":"        stats[\"frequency\"] \u003d self.get_cpu_frequency()"},{"line_number":3768,"context_line":"        return stats"},{"line_number":3769,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F6gQ%3D","line":3766,"updated":"2013-08-15 09:55:09.000000000","message":"Is there really any point in this \u0027total\u0027 value - can\u0027t the caller just calculate this if they so desire.","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"2605372e0b16d4b5078433e21c06da405beffef1","unresolved":false,"context_lines":[{"line_number":3763,"context_line":"        \"\"\"Return the current CPU state of the host.\"\"\""},{"line_number":3764,"context_line":"        # Extract node\u0027s CPU statistics."},{"line_number":3765,"context_line":"        stats \u003d self._conn.getCPUStats(libvirt.VIR_NODE_CPU_STATS_ALL_CPUS, 0)"},{"line_number":3766,"context_line":"        stats[\"total\"] \u003d sum(stats.values())"},{"line_number":3767,"context_line":"        stats[\"frequency\"] \u003d self.get_cpu_frequency()"},{"line_number":3768,"context_line":"        return stats"},{"line_number":3769,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAARH%2F%2F3Rs%3D","line":3766,"in_reply_to":"AAAARH%2F%2F6gQ%3D","updated":"2013-08-16 05:14:23.000000000","message":"OK, Done.","commit_id":"650f9c134b80e3e26af2572b39b60129520796ae"}]}
