)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"59768cc9fe565019dd40e40e0f5c206bcceafb4c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add volume usage cache tables to record no. of reads, bytes read,"},{"line_number":10,"context_line":"no. of write, bytes written to a volume."},{"line_number":11,"context_line":"A periodic task runs in compute manager to query each volume mounted"},{"line_number":12,"context_line":"on a compute host and record it\u0027s usage, this task also send a"},{"line_number":13,"context_line":"volume.usage notification contains volume usage statistics"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Part of blueprint volume-usage-metering"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAMH%2F%2Fvu4%3D","line":12,"updated":"2012-11-27 16:14:54.000000000","message":"femtonit: This actually reads \"and record it is usage\", if you expand the contraction; I believe you actually want to use \"its\".  (Pet peeve of mine…)","commit_id":"79f1d5a16fd715362eb7de81ba8f7d5240d8ba81"}],"nova/compute/manager.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"d72b25619a45884689384502bb0b7af1f157c6a7","unresolved":false,"context_lines":[{"line_number":2015,"context_line":"                pass"},{"line_number":2016,"context_line":""},{"line_number":2017,"context_line":"            if vol_stats:"},{"line_number":2018,"context_line":"                LOG.info(_(\"Updating volume usage cache with totals\"))"},{"line_number":2019,"context_line":"                rd_req, rd_bytes, wr_req, wr_bytes, flush_ops \u003d vol_stats"},{"line_number":2020,"context_line":"                self.db.vol_usage_update(context, volume_id, rd_req, rd_bytes,"},{"line_number":2021,"context_line":"                                         wr_req, wr_bytes, update_totals\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fwd8%3D","line":2018,"updated":"2012-08-14 15:56:04.000000000","message":"Should this be a debug message?","commit_id":"ba4cd030b0dae57545de9da45a9f1fd135eca0c1"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"d72b25619a45884689384502bb0b7af1f157c6a7","unresolved":false,"context_lines":[{"line_number":2599,"context_line":""},{"line_number":2600,"context_line":"    @manager.periodic_task"},{"line_number":2601,"context_line":"    def _poll_volume_usage(self, context, start_time\u003dNone):"},{"line_number":2602,"context_line":"        if FLAGS.volume_usage_task:"},{"line_number":2603,"context_line":"            if not start_time:"},{"line_number":2604,"context_line":"                start_time \u003d utils.last_completed_audit_period()[1]"},{"line_number":2605,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FweQ%3D","line":2602,"updated":"2012-08-14 15:56:04.000000000","message":"Instead of having the whole function inside this if block:\n\nif not FLAGS.volume_usage_task:\n    return\n\n... everything else ...","commit_id":"ba4cd030b0dae57545de9da45a9f1fd135eca0c1"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"d72b25619a45884689384502bb0b7af1f157c6a7","unresolved":false,"context_lines":[{"line_number":2605,"context_line":""},{"line_number":2606,"context_line":"            curr_time \u003d time.time()"},{"line_number":2607,"context_line":"            if curr_time - self._last_vol_usage_poll \u003e \\"},{"line_number":2608,"context_line":"                    FLAGS.volume_poll_interval:"},{"line_number":2609,"context_line":"                self._last_vol_usage_poll \u003d curr_time"},{"line_number":2610,"context_line":"                LOG.info(_(\"Updating volume usage cache\"))"},{"line_number":2611,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FweM%3D","line":2608,"updated":"2012-08-14 15:56:04.000000000","message":"Another good place to reduce nesting","commit_id":"ba4cd030b0dae57545de9da45a9f1fd135eca0c1"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"d72b25619a45884689384502bb0b7af1f157c6a7","unresolved":false,"context_lines":[{"line_number":2607,"context_line":"            if curr_time - self._last_vol_usage_poll \u003e \\"},{"line_number":2608,"context_line":"                    FLAGS.volume_poll_interval:"},{"line_number":2609,"context_line":"                self._last_vol_usage_poll \u003d curr_time"},{"line_number":2610,"context_line":"                LOG.info(_(\"Updating volume usage cache\"))"},{"line_number":2611,"context_line":""},{"line_number":2612,"context_line":"                instances \u003d self.db.instance_get_all_by_host(context,"},{"line_number":2613,"context_line":"                                                             self.host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fwd0%3D","line":2610,"updated":"2012-08-14 15:56:04.000000000","message":"This seems like a debug message, too","commit_id":"ba4cd030b0dae57545de9da45a9f1fd135eca0c1"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"9246a729a4b655d6583950a6a184e062058a606e","unresolved":false,"context_lines":[{"line_number":2971,"context_line":"    def _poll_volume_usage(self, context, start_time\u003dNone):"},{"line_number":2972,"context_line":"        if not CONF.volume_usage_task:"},{"line_number":2973,"context_line":"            return"},{"line_number":2974,"context_line":"        else:"},{"line_number":2975,"context_line":"            if not start_time:"},{"line_number":2976,"context_line":"                start_time \u003d utils.last_completed_audit_period()[1]"},{"line_number":2977,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2Fyao%3D","line":2974,"updated":"2012-11-23 17:19:18.000000000","message":"This else and a few others in this function can be factored out to reduce the nesting quite a bit and make this a bit more readable.","commit_id":"c3131e94f251b84d30d64fc01854d00053addf32"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"c70440394bcb5f56f4c49849249a213303292972","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                     \"notifications\"),"},{"line_number":138,"context_line":"    cfg.IntOpt(\u0027volume_poll_interval\u0027,"},{"line_number":139,"context_line":"               default\u003d600,"},{"line_number":140,"context_line":"               help\u003d\u0027interval to pull volume usage info\u0027),"},{"line_number":141,"context_line":"]"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"timeout_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAMX%2F%2F%2F0A%3D","line":140,"updated":"2012-12-03 11:25:52.000000000","message":"Normally these two are represented by one flag... A value of zero means to disable the task. See the usage of image_cache_manager_interval for an example.","commit_id":"1ffaa3cf32e9591d339318e650afc6921c9bd5ad"}],"nova/compute/utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"59768cc9fe565019dd40e40e0f5c206bcceafb4c","unresolved":false,"context_lines":[{"line_number":236,"context_line":"    last_refreshed_time \u003d vol_usage[\u0027tot_last_refreshed\u0027] if \\"},{"line_number":237,"context_line":"          (vol_usage[\u0027tot_last_refreshed\u0027] \u003e"},{"line_number":238,"context_line":"           vol_usage[\u0027curr_last_refreshed\u0027]) \\"},{"line_number":239,"context_line":"          else vol_usage[\u0027curr_last_refreshed\u0027]"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    usage_info \u003d dict("},{"line_number":242,"context_line":"          volume_id\u003dvol_usage[\u0027volume_id\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAMH%2F%2Fvuk%3D","line":239,"updated":"2012-11-27 16:14:54.000000000","message":"Nit: I really would prefer to have this whole expression enclosed in parentheses, so we can eliminate the backslash continuation.  Alternatively, you may want to consider using temporary variables, i.e.:\n\n    tot_refreshed \u003d vol_usage[\u0027tot_last_refreshed\u0027]\n    curr_refreshed \u003d vol_usage[\u0027curr_last_refreshed\u0027]\n    last_refreshed_time \u003d (tot_refreshed if tot_refreshed \u003c curr_refreshed\n                           else curr_refreshed)","commit_id":"79f1d5a16fd715362eb7de81ba8f7d5240d8ba81"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"d72b25619a45884689384502bb0b7af1f157c6a7","unresolved":false,"context_lines":[{"line_number":4661,"context_line":"        vol_usage \u003d model_query(context, models.VolumeUsage,"},{"line_number":4662,"context_line":"                                session\u003dsession, read_deleted\u003d\"yes\").\\"},{"line_number":4663,"context_line":"                        filter_by(volume_id\u003did).\\"},{"line_number":4664,"context_line":"                        first()"},{"line_number":4665,"context_line":""},{"line_number":4666,"context_line":"        if not vol_usage:"},{"line_number":4667,"context_line":"            vol_usage \u003d models.VolumeUsage()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fwco%3D","line":4664,"updated":"2012-08-14 15:56:04.000000000","message":"I think this can be optimized for the update case (vs creating a new row).  Take a look at this review for an example of what I mean: https://review.openstack.org/#/c/11267/","commit_id":"ba4cd030b0dae57545de9da45a9f1fd135eca0c1"}],"nova/flags.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"d72b25619a45884689384502bb0b7af1f157c6a7","unresolved":false,"context_lines":[{"line_number":326,"context_line":"    cfg.IntOpt(\u0027bandwith_poll_interval\u0027,"},{"line_number":327,"context_line":"               default\u003d600,"},{"line_number":328,"context_line":"               help\u003d\u0027interval to pull bandwidth usage info\u0027),"},{"line_number":329,"context_line":"    cfg.IntOpt(\u0027volume_poll_interval\u0027,"},{"line_number":330,"context_line":"               default\u003d600,"},{"line_number":331,"context_line":"               help\u003d\u0027interval to pull volume usage info\u0027),"},{"line_number":332,"context_line":"    cfg.BoolOpt(\u0027start_guests_on_host_boot\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fwdk%3D","line":329,"updated":"2012-08-14 15:56:04.000000000","message":"I think this should be moved over to where the option is to enable this so that they are together.  I know there are some bad examples just above this of doing the opposite.  :-)","commit_id":"ba4cd030b0dae57545de9da45a9f1fd135eca0c1"}],"nova/tests/test_libvirt.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a93b785fd1085e79863c195cede5ebbbf1634b0","unresolved":false,"context_lines":[{"line_number":3710,"context_line":"        db.block_device_mapping_create(self.c, values)"},{"line_number":3711,"context_line":""},{"line_number":3712,"context_line":"    def test_get_all_volume_usage(self):"},{"line_number":3713,"context_line":"        \"\"\"Test for nova.virt.libvirt.libvirt_driver.LivirtConnection"},{"line_number":3714,"context_line":"        .get_all_volume_usage. \"\"\""},{"line_number":3715,"context_line":""},{"line_number":3716,"context_line":"        def fake_block_stats(instance_name, disk):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fzyw%3D","line":3713,"updated":"2012-08-10 15:43:50.000000000","message":"\"LibvirtConnection\" misspelled","commit_id":"a9ecb3bf7d4b5d5fc384590b4efac54099a4ef3b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a93b785fd1085e79863c195cede5ebbbf1634b0","unresolved":false,"context_lines":[{"line_number":3727,"context_line":"        self.assertEqual(vol_usage, expected_usage)"},{"line_number":3728,"context_line":""},{"line_number":3729,"context_line":"    def test_get_all_volume_usage_device_not_found(self):"},{"line_number":3730,"context_line":"        \"\"\"Confirm excpetion handled when block_stats fails. \"\"\""},{"line_number":3731,"context_line":""},{"line_number":3732,"context_line":"        def fake_block_stats(instance_name, disk):"},{"line_number":3733,"context_line":"            raise libvirt.libvirtError(\u0027invalid path\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fzy0%3D","line":3730,"updated":"2012-08-10 15:43:50.000000000","message":"\"exception\" misspelled","commit_id":"a9ecb3bf7d4b5d5fc384590b4efac54099a4ef3b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"fe9daabfa64a12488570c62b293c3e7c3934a96e","unresolved":false,"context_lines":[{"line_number":3740,"context_line":"        db.block_device_mapping_create(self.c, values)"},{"line_number":3741,"context_line":""},{"line_number":3742,"context_line":"    def test_get_all_volume_usage(self):"},{"line_number":3743,"context_line":"        \"\"\"Test for nova.virt.libvirt.libvirt_driver.LibvirtDriver"},{"line_number":3744,"context_line":"        .get_all_volume_usage. \"\"\""},{"line_number":3745,"context_line":""},{"line_number":3746,"context_line":"        def fake_block_stats(instance_name, disk):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Foaw%3D","line":3743,"updated":"2012-08-24 15:16:36.000000000","message":"I recommend dropping docstrings from tests, as they make it difficult to determine which test case is failing (nose reports the docstring rather than the test name).","commit_id":"20f4be44f83de13b2a3be2ac65b1cadd0b2f2a4c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"fe9daabfa64a12488570c62b293c3e7c3934a96e","unresolved":false,"context_lines":[{"line_number":3768,"context_line":""},{"line_number":3769,"context_line":"        self.assertEqual(vol_usage, [])"},{"line_number":3770,"context_line":""},{"line_number":3771,"context_line":"    def tearDown(self):"},{"line_number":3772,"context_line":"        super(LibvirtVolumeUsageTestCase, self).tearDown()"},{"line_number":3773,"context_line":""},{"line_number":3774,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Foak%3D","line":3771,"updated":"2012-08-24 15:16:36.000000000","message":"1) I prefer tearDown() to be defined immediately after setUp(), since they usually need to be in pairs—it makes it easier to see what\u0027s happening in a given test cycle.\n\n2) This tearDown() method does nothing other than calling the superclass; please remove it if you don\u0027t need it.","commit_id":"20f4be44f83de13b2a3be2ac65b1cadd0b2f2a4c"}]}
