)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20873,"name":"Laszlo Hegedus","email":"hegedues.laszlo@gmail.com","username":"laszloh"},"change_message_id":"d8a047d0ce625dfdaba7a1c2fc32acb78f5f0818","unresolved":false,"context_lines":[{"line_number":19,"context_line":"process.username()"},{"line_number":20,"context_line":"process.cmdline()"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"While in older versions than 2.0.0, those are not methods:"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"process.name"},{"line_number":25,"context_line":"process.pid"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7aa08908_3700ba35","line":22,"range":{"start_line":22,"start_character":6,"end_line":22,"end_character":34},"updated":"2016-06-15 08:22:43.000000000","message":"I think\n\n\u0027in versions newer than 2.0.0\u0027\n\nsounds better.","commit_id":"8dffaffc145a024471c4b9b73c8adfb7e5c63df8"}],"monasca_agent/collector/checks_d/process.py":[{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"4d4493fe036e4c572aaebe71fec4d0f07773b1ca","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self._current_process_list \u003d None"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    @classmethod"},{"line_number":29,"context_line":"    def factory(cls, name, init_config, agent_config, instances\u003dNone):"},{"line_number":30,"context_line":"        # if psutil is older than 2.0.0, the process details have to be"},{"line_number":31,"context_line":"        # accessed differently."},{"line_number":32,"context_line":"        if ProcessCheck.is_psutil_version_later_than((2, 0, 0)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_0e07ba18","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":70},"updated":"2016-05-31 21:48:08.000000000","message":"Can you explain how this method is used?  It\u0027s not directly called, unless I\u0027m missing it, so I assume it\u0027s some sort of magic.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d9794deaa98174e57b20e29d162ed1893cd04f76","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self._current_process_list \u003d None"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    @classmethod"},{"line_number":29,"context_line":"    def factory(cls, name, init_config, agent_config, instances\u003dNone):"},{"line_number":30,"context_line":"        # if psutil is older than 2.0.0, the process details have to be"},{"line_number":31,"context_line":"        # accessed differently."},{"line_number":32,"context_line":"        if ProcessCheck.is_psutil_version_later_than((2, 0, 0)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_cebbf2e3","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":70},"in_reply_to":"9abb7d3a_0e07ba18","updated":"2016-05-31 22:07:57.000000000","message":"it\u0027s not magic.\n\nit is a factory method, that is being used when the checkers are initialized. instead of using the constructor, this is used instead.\n\ncheck the previous patch: https://review.openstack.org/#/c/323034/2/monasca_agent/common/util.py","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"31003ce75f3e33538d839fd4b7d30b04a44ab3a6","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self._current_process_list \u003d None"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    @classmethod"},{"line_number":29,"context_line":"    def factory(cls, name, init_config, agent_config, instances\u003dNone):"},{"line_number":30,"context_line":"        # if psutil is older than 2.0.0, the process details have to be"},{"line_number":31,"context_line":"        # accessed differently."},{"line_number":32,"context_line":"        if ProcessCheck.is_psutil_version_later_than((2, 0, 0)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_8e560a28","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":70},"in_reply_to":"9abb7d3a_cebbf2e3","updated":"2016-05-31 22:14:25.000000000","message":"seems that unit tests are using the OldProcessCheck, for some reason, although psutil is 3.0.1 and (3, 0, 1) \u003e\u003d (2, 0, 0) is True..\n\nhave to investigate.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"4d4493fe036e4c572aaebe71fec4d0f07773b1ca","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        for process in psutil.process_iter():"},{"line_number":158,"context_line":"            try:"},{"line_number":159,"context_line":"                process_dict \u003d self._get_process_info(process)"},{"line_number":160,"context_line":"                p \u003d ProcessStruct(**process_dict)"},{"line_number":161,"context_line":"                self._current_process_list.append(p)"},{"line_number":162,"context_line":"            except psutil.NoSuchProcess:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_3324a7c3","line":159,"range":{"start_line":159,"start_character":0,"end_line":159,"end_character":62},"updated":"2016-05-31 21:48:08.000000000","message":"Can you do this without bothering to allocate the extra dict in the middle?  Why not just have _get_process_info just return the named tuple?","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d9794deaa98174e57b20e29d162ed1893cd04f76","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        for process in psutil.process_iter():"},{"line_number":158,"context_line":"            try:"},{"line_number":159,"context_line":"                process_dict \u003d self._get_process_info(process)"},{"line_number":160,"context_line":"                p \u003d ProcessStruct(**process_dict)"},{"line_number":161,"context_line":"                self._current_process_list.append(p)"},{"line_number":162,"context_line":"            except psutil.NoSuchProcess:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_8e756afb","line":159,"range":{"start_line":159,"start_character":0,"end_line":159,"end_character":62},"in_reply_to":"9abb7d3a_3324a7c3","updated":"2016-05-31 22:07:57.000000000","message":"Sure, I can create a named tuple, but I don\u0027t see how it helps. It sounds like another extra step in addition to the dict one.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"ed124c8f3f540f4183a1f7b8abfbdda1390a158b","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        for process in psutil.process_iter():"},{"line_number":158,"context_line":"            try:"},{"line_number":159,"context_line":"                process_dict \u003d self._get_process_info(process)"},{"line_number":160,"context_line":"                p \u003d ProcessStruct(**process_dict)"},{"line_number":161,"context_line":"                self._current_process_list.append(p)"},{"line_number":162,"context_line":"            except psutil.NoSuchProcess:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_09b21406","line":159,"range":{"start_line":159,"start_character":0,"end_line":159,"end_character":62},"in_reply_to":"9abb7d3a_49437c42","updated":"2016-05-31 22:32:57.000000000","message":"oooh, I see what you mean now. Yeah, makes sense.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"1781c530e1d3f0e2c66062b45409ecd7f1781617","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        for process in psutil.process_iter():"},{"line_number":158,"context_line":"            try:"},{"line_number":159,"context_line":"                process_dict \u003d self._get_process_info(process)"},{"line_number":160,"context_line":"                p \u003d ProcessStruct(**process_dict)"},{"line_number":161,"context_line":"                self._current_process_list.append(p)"},{"line_number":162,"context_line":"            except psutil.NoSuchProcess:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_49437c42","line":159,"range":{"start_line":159,"start_character":0,"end_line":159,"end_character":62},"in_reply_to":"9abb7d3a_8e756afb","updated":"2016-05-31 22:23:12.000000000","message":"I\u0027m saying ditch the dict creation and just return a ProcessStruct and assign to p directly from the return of the _get_prcess_info function.  No need for additional allocation that you\u0027re just throwing away.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"4d4493fe036e4c572aaebe71fec4d0f07773b1ca","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                pass"},{"line_number":165,"context_line":"            except psutil.AccessDenied as e:"},{"line_number":166,"context_line":"                self.log.info(\u0027Access denied to process {0}: {1}\u0027.format("},{"line_number":167,"context_line":"                    process_dict[\u0027name\u0027], e))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _get_process_info(self, process):"},{"line_number":170,"context_line":"        return dict(name\u003dprocess.name(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_738e2fd1","line":167,"range":{"start_line":167,"start_character":20,"end_line":167,"end_character":45},"updated":"2016-05-31 21:48:08.000000000","message":"This won\u0027t work if there is a failure.  process_dict is not guaranteed to be filled out.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"5edbb39dbcfaf2ee936e04aa0adb009cf4630d8a","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                pass"},{"line_number":165,"context_line":"            except psutil.AccessDenied as e:"},{"line_number":166,"context_line":"                self.log.info(\u0027Access denied to process {0}: {1}\u0027.format("},{"line_number":167,"context_line":"                    process_dict[\u0027name\u0027], e))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _get_process_info(self, process):"},{"line_number":170,"context_line":"        return dict(name\u003dprocess.name(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_8dc9ef5b","line":167,"range":{"start_line":167,"start_character":20,"end_line":167,"end_character":45},"in_reply_to":"9abb7d3a_09a33401","updated":"2016-05-31 23:16:58.000000000","message":"Thinking about it I don\u0027t see how it could create a dict if an exception is thrown during the dict construction.  If we never assign to the dict because of an exception though I don\u0027t think we\u0027d damage any data already resident in the dict.\n\nDo you think it\u0027s possible you\u0027re seeing error output referencing data from the previous loop where the dict was constructed properly?","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d9794deaa98174e57b20e29d162ed1893cd04f76","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                pass"},{"line_number":165,"context_line":"            except psutil.AccessDenied as e:"},{"line_number":166,"context_line":"                self.log.info(\u0027Access denied to process {0}: {1}\u0027.format("},{"line_number":167,"context_line":"                    process_dict[\u0027name\u0027], e))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _get_process_info(self, process):"},{"line_number":170,"context_line":"        return dict(name\u003dprocess.name(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_ae95ce33","line":167,"range":{"start_line":167,"start_character":20,"end_line":167,"end_character":45},"in_reply_to":"9abb7d3a_738e2fd1","updated":"2016-05-31 22:07:57.000000000","message":"hm, my logs would disagree with you. :)\n\nhttp://paste.openstack.org/show/506661/","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"e25756eb66e9a0e0dd8c389fd2f344a9b384b71d","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                pass"},{"line_number":165,"context_line":"            except psutil.AccessDenied as e:"},{"line_number":166,"context_line":"                self.log.info(\u0027Access denied to process {0}: {1}\u0027.format("},{"line_number":167,"context_line":"                    process_dict[\u0027name\u0027], e))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _get_process_info(self, process):"},{"line_number":170,"context_line":"        return dict(name\u003dprocess.name(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_b0436841","line":167,"range":{"start_line":167,"start_character":20,"end_line":167,"end_character":45},"in_reply_to":"9abb7d3a_8dc9ef5b","updated":"2016-05-31 23:36:37.000000000","message":"it might be. but it should be fine now in the latest patchset.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"1781c530e1d3f0e2c66062b45409ecd7f1781617","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                pass"},{"line_number":165,"context_line":"            except psutil.AccessDenied as e:"},{"line_number":166,"context_line":"                self.log.info(\u0027Access denied to process {0}: {1}\u0027.format("},{"line_number":167,"context_line":"                    process_dict[\u0027name\u0027], e))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _get_process_info(self, process):"},{"line_number":170,"context_line":"        return dict(name\u003dprocess.name(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_09a33401","line":167,"range":{"start_line":167,"start_character":20,"end_line":167,"end_character":45},"in_reply_to":"9abb7d3a_ae95ce33","updated":"2016-05-31 22:23:12.000000000","message":"That\u0027s fine but I\u0027d prefer to use the method we know works in the cases we\u0027ve been testing.  I don\u0027t see any value in the change just some potential risk.","commit_id":"ab5f2dbc28111fd2bf1de143adf4fb989982d648"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"506841a465e38ec9b8c73261e1648ca2988e3634","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        # accessed differently."},{"line_number":32,"context_line":"        if ProcessCheck.is_psutil_version_later_than((2, 0, 0)):"},{"line_number":33,"context_line":"            return ProcessCheck(name, init_config, agent_config, instances)"},{"line_number":34,"context_line":"        return OldProcessCheck(name, init_config, agent_config, instances)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @staticmethod"},{"line_number":37,"context_line":"    def is_psutil_version_later_than(v):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_cfdaf2e7","line":34,"range":{"start_line":34,"start_character":15,"end_line":34,"end_character":30},"updated":"2016-06-07 18:25:11.000000000","message":"I had a similar comment on the CPU checker, but it seems like pulling this factory outside of this class as having a base class know about it\u0027s derived classes has always been something to try and avoid if possible.","commit_id":"a6d276e049648315eff26a0556f0530ce6e13623"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"506841a465e38ec9b8c73261e1648ca2988e3634","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                    self.gauge(metric_name, metric_value, dimensions\u003ddimensions)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class OldProcessCheck(ProcessCheck):"},{"line_number":213,"context_line":"    \"\"\"Process checker for psutil older than 2.0.0\"\"\""},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def _get_process_name(self, process):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_8fa2aa49","line":212,"range":{"start_line":212,"start_character":6,"end_line":212,"end_character":21},"updated":"2016-06-07 18:25:11.000000000","message":"Was wondering if you wanted to call this the Pre20ProcessCheck?","commit_id":"a6d276e049648315eff26a0556f0530ce6e13623"}]}
