)]}'
{"nova/compute/stats.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"857a56caa1bb3c8a409eea9ebee01bb6643f8691","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        x \u003d self.get(key, 0)"},{"line_number":197,"context_line":"        self[key] \u003d x + 1"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def _extract_state_from_instance(instance):"},{"line_number":200,"context_line":"        \"\"\"Save the useful bits of instance state for tracking purposes\"\"\""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        uuid \u003d instance[\u0027uuid\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Ff7U%3D","line":199,"updated":"2012-09-05 23:25:19.000000000","message":"Where\u0027s self?","commit_id":"0b884eda571ce4e086dec68115d0ebfe003e3b26"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"857a56caa1bb3c8a409eea9ebee01bb6643f8691","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        return (vm_state, task_state, os_type, project_id, vcpus)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def _decrement(self, key):"},{"line_number":216,"context_line":"        x \u003d self.get(key, 0)"},{"line_number":217,"context_line":"        self[key] \u003d x - 1"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Ff7Q%3D","line":215,"updated":"2012-09-05 23:25:19.000000000","message":"You\u0027ve got two copies of _decrement() and _increment() now…","commit_id":"0b884eda571ce4e086dec68115d0ebfe003e3b26"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"857a56caa1bb3c8a409eea9ebee01bb6643f8691","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        x \u003d self.get(key, 0)"},{"line_number":221,"context_line":"        self[key] \u003d x + 1"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def _extract_state_from_instance(self, instance):"},{"line_number":224,"context_line":"        \"\"\"Save the useful bits of instance state for tracking purposes\"\"\""},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        uuid \u003d instance[\u0027uuid\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Ff7I%3D","line":223,"updated":"2012-09-05 23:25:19.000000000","message":"Oh, and you\u0027ve got a second copy of this method…","commit_id":"0b884eda571ce4e086dec68115d0ebfe003e3b26"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"d715122080a8b42aa74d934d459c16674d77b9be","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            self._decrement(\"num_vm_%s\" % old_state[\u0027vm_state\u0027])"},{"line_number":88,"context_line":"            self._decrement(\"num_task_%s\" % old_state[\u0027task_state\u0027])"},{"line_number":89,"context_line":"            self._decrement(\"num_os_type_%s\" % old_state[\u0027os_type\u0027])"},{"line_number":90,"context_line":"            self._decrement(\"num_proj_%s\" % old_state[\u0027project_id\u0027])"},{"line_number":91,"context_line":"            x \u003d self.get(\"num_vcpus_used\", 0)"},{"line_number":92,"context_line":"            self[\"num_vcpus_used\"] \u003d x - old_state[\u0027vcpus\u0027]"},{"line_number":93,"context_line":"            self._decrement(\"num_instances\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FfhA%3D","line":90,"updated":"2012-09-06 15:00:21.000000000","message":"Would it make sense to only decrement (and increment below) for instance fields that have actually been modified?","commit_id":"24469abc904738968c8bb176a82138f0b8254f26"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"13c4acc9988df9ade3feaf622d7b02843b61364b","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            self._decrement(\"num_vm_%s\" % old_state[\u0027vm_state\u0027])"},{"line_number":88,"context_line":"            self._decrement(\"num_task_%s\" % old_state[\u0027task_state\u0027])"},{"line_number":89,"context_line":"            self._decrement(\"num_os_type_%s\" % old_state[\u0027os_type\u0027])"},{"line_number":90,"context_line":"            self._decrement(\"num_proj_%s\" % old_state[\u0027project_id\u0027])"},{"line_number":91,"context_line":"            x \u003d self.get(\"num_vcpus_used\", 0)"},{"line_number":92,"context_line":"            self[\"num_vcpus_used\"] \u003d x - old_state[\u0027vcpus\u0027]"},{"line_number":93,"context_line":"            self._decrement(\"num_instances\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FfTc%3D","line":90,"in_reply_to":"AAAALH%2F%2FfhA%3D","updated":"2012-09-06 18:51:32.000000000","message":"Just tried it, it gets a little ugly with conditionals on not decrementing with new instances and conversely, not incrementing with newly deleted instances.  I think this way is cleaner.","commit_id":"24469abc904738968c8bb176a82138f0b8254f26"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"61e7d7b224ef16b0d0e016fea7aca9f27e484fb6","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            self._decrement(\"num_vm_%s\" % old_state[\u0027vm_state\u0027])"},{"line_number":88,"context_line":"            self._decrement(\"num_task_%s\" % old_state[\u0027task_state\u0027])"},{"line_number":89,"context_line":"            self._decrement(\"num_os_type_%s\" % old_state[\u0027os_type\u0027])"},{"line_number":90,"context_line":"            self._decrement(\"num_proj_%s\" % old_state[\u0027project_id\u0027])"},{"line_number":91,"context_line":"            x \u003d self.get(\"num_vcpus_used\", 0)"},{"line_number":92,"context_line":"            self[\"num_vcpus_used\"] \u003d x - old_state[\u0027vcpus\u0027]"},{"line_number":93,"context_line":"            self._decrement(\"num_instances\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fffg%3D","line":90,"in_reply_to":"AAAALH%2F%2FfhA%3D","updated":"2012-09-06 15:36:33.000000000","message":"Yeah, I could do that. I think it\u0027s largely just a matter of preference.  The runtime should be pretty similar with either style.  I chose to make it simpler without the if statements.\nIn the case where stats are being added for a new instance, this avoids the hassle of handling non-existent \"old stats\" when doing comparisons.","commit_id":"24469abc904738968c8bb176a82138f0b8254f26"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"d715122080a8b42aa74d934d459c16674d77b9be","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            self._decrement(\"num_proj_%s\" % old_state[\u0027project_id\u0027])"},{"line_number":91,"context_line":"            x \u003d self.get(\"num_vcpus_used\", 0)"},{"line_number":92,"context_line":"            self[\"num_vcpus_used\"] \u003d x - old_state[\u0027vcpus\u0027]"},{"line_number":93,"context_line":"            self._decrement(\"num_instances\")"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        # Now update stats from the new instance state:"},{"line_number":96,"context_line":"        (vm_state, task_state, os_type, project_id, vcpus) \u003d \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FfhE%3D","line":93,"updated":"2012-09-06 15:00:21.000000000","message":"Is this line only required in the deletion case?\n\nSimpler to avoid decrement and re-increment in the normal case, e.g.:\n\n            - self._decrement(\"num_instances\")\n        ...\n        if vm_state \u003d\u003d vm_states.DELETED:\n\t    self.states.pop(uuid)\n            + self._decrement(\"num_instances\")\n        ...\n            - self._increment(\"num_instances\")","commit_id":"24469abc904738968c8bb176a82138f0b8254f26"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"13c4acc9988df9ade3feaf622d7b02843b61364b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            self._decrement(\"num_proj_%s\" % old_state[\u0027project_id\u0027])"},{"line_number":91,"context_line":"            x \u003d self.get(\"num_vcpus_used\", 0)"},{"line_number":92,"context_line":"            self[\"num_vcpus_used\"] \u003d x - old_state[\u0027vcpus\u0027]"},{"line_number":93,"context_line":"            self._decrement(\"num_instances\")"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        # Now update stats from the new instance state:"},{"line_number":96,"context_line":"        (vm_state, task_state, os_type, project_id, vcpus) \u003d \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FfTg%3D","line":93,"in_reply_to":"AAAALH%2F%2FfhE%3D","updated":"2012-09-06 18:51:32.000000000","message":"Done","commit_id":"24469abc904738968c8bb176a82138f0b8254f26"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"61e7d7b224ef16b0d0e016fea7aca9f27e484fb6","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            self._decrement(\"num_proj_%s\" % old_state[\u0027project_id\u0027])"},{"line_number":91,"context_line":"            x \u003d self.get(\"num_vcpus_used\", 0)"},{"line_number":92,"context_line":"            self[\"num_vcpus_used\"] \u003d x - old_state[\u0027vcpus\u0027]"},{"line_number":93,"context_line":"            self._decrement(\"num_instances\")"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        # Now update stats from the new instance state:"},{"line_number":96,"context_line":"        (vm_state, task_state, os_type, project_id, vcpus) \u003d \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FffM%3D","line":93,"in_reply_to":"AAAALH%2F%2FfhE%3D","updated":"2012-09-06 15:36:33.000000000","message":"True, I could just add an increment for new instances, and decrement on delete.","commit_id":"24469abc904738968c8bb176a82138f0b8254f26"}],"nova/tests/compute/test_stats.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"857a56caa1bb3c8a409eea9ebee01bb6643f8691","unresolved":false,"context_lines":[{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        self.assertEqual(6, self.stats.calculate_io_workload())"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def test_clear(self):"},{"line_number":189,"context_line":"        instance \u003d self._create_instance()"},{"line_number":190,"context_line":"        self.stats.update_stats_for_instance(instance)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Ff7A%3D","line":188,"updated":"2012-09-05 23:25:19.000000000","message":"Are we actually using clear() anywhere?  I probably just failed to notice it first time through…","commit_id":"0b884eda571ce4e086dec68115d0ebfe003e3b26"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"61cc8b6ba804a9e437f78b27899545dc23718d47","unresolved":false,"context_lines":[{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        self.assertEqual(6, self.stats.calculate_io_workload())"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def test_clear(self):"},{"line_number":189,"context_line":"        instance \u003d self._create_instance()"},{"line_number":190,"context_line":"        self.stats.update_stats_for_instance(instance)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Ffzw%3D","line":188,"in_reply_to":"AAAALH%2F%2Ff7A%3D","updated":"2012-09-06 02:33:05.000000000","message":"Yeah, the resource tracker clears the stats when \"update_available_resource\" gets called periodically to audit the stats and resource usage.","commit_id":"0b884eda571ce4e086dec68115d0ebfe003e3b26"}]}
