)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3ae09a774eb8ad21a2359904060483fab4bfe597","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"For bp publisher-counters-frequency"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"For bug 126990"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I3c1163e37de6a17261d2c570843845696ebff58f"},{"line_number":21,"context_line":"Signed-off-by: Yunhong, Jiang \u003cyunhong.jiang@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAAM3%2F%2BxsA%3D","line":18,"updated":"2013-02-19 14:40:36.000000000","message":"Wrong bug number.","commit_id":"1902c4952a35c99de12b12dc05e77ef9ab58ecb4"}],"ceilometer/agent.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setup_polling_tasks(self):"},{"line_number":71,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":72,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":73,"context_line":"                self.pollster_manager.extensions):"},{"line_number":74,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B01k%3D","line":71,"updated":"2013-02-18 14:04:50.000000000","message":"Please find a way to reimplement this loop without using an n^2 algorithm. It asks the same questions of pollsters and pipelines over and over, and it seems like some of that information should be cacheable or even available directly from the pipeline. For example, why do we have to figure out which extensions the pipeline uses, doesn\u0027t the pipeline know that? \n\nIn fact, why isn\u0027t this a simple loop to create one task for each interval value where the task knows all of the pipelines it needs to update?","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setup_polling_tasks(self):"},{"line_number":71,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":72,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":73,"context_line":"                self.pollster_manager.extensions):"},{"line_number":74,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byz0%3D","line":71,"in_reply_to":"AAAAM3%2F%2B01k%3D","updated":"2013-02-21 02:00:58.000000000","message":"The polling task will have two information. It will keep all pipelines that should be invoked (pipeline with same interval for polling, or all pipelines for nova notifier), it will also keep the pollster that will provide the data required by these pipelines, so that the polling task don\u0027t need poll all pollsters. (I keep the counters so that in future, pollster may need only polls part of the counters, but not used now).\n\nTo achieve this, I think we have to check all the pipeline/pollster pairs. As it\u0027s only at initialization time, I assume the cost should be acceptable?","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"},{"line_number":75,"context_line":"                        if pipeline.support_counter(c)]"},{"line_number":76,"context_line":"            if counters:"},{"line_number":77,"context_line":"                polling_task \u003d self.polling_tasks.get("},{"line_number":78,"context_line":"                    pipeline.interval,"},{"line_number":79,"context_line":"                    self.polling_task(self))"},{"line_number":80,"context_line":"                polling_task.add(pollster, counters, [pipeline])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B010%3D","line":77,"updated":"2013-02-18 14:04:50.000000000","message":"This expression will always call self.polling_task(), then frequently (I assume) discard the results. It would be better to leave the default as None and check it explicitly before invoking another function.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"},{"line_number":75,"context_line":"                        if pipeline.support_counter(c)]"},{"line_number":76,"context_line":"            if counters:"},{"line_number":77,"context_line":"                polling_task \u003d self.polling_tasks.get("},{"line_number":78,"context_line":"                    pipeline.interval,"},{"line_number":79,"context_line":"                    self.polling_task(self))"},{"line_number":80,"context_line":"                polling_task.add(pollster, counters, [pipeline])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byyc%3D","line":77,"in_reply_to":"AAAAM3%2F%2B010%3D","updated":"2013-02-21 02:00:58.000000000","message":"Thanks for reminding. I didn\u0027t realize that the default value is called even when the corresponding key/value pairs exists. (Really strange why not lazy-created here).\n\nWill change it.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            if counters:"},{"line_number":77,"context_line":"                polling_task \u003d self.polling_tasks.get("},{"line_number":78,"context_line":"                    pipeline.interval,"},{"line_number":79,"context_line":"                    self.polling_task(self))"},{"line_number":80,"context_line":"                polling_task.add(pollster, counters, [pipeline])"},{"line_number":81,"context_line":"                self.polling_tasks[pipeline.interval] \u003d polling_task"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B02A%3D","line":79,"updated":"2013-02-18 14:04:50.000000000","message":"I don\u0027t see self.polling_task defined anywhere in this file. If it is a factory function, it should have a verb in the name.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            if counters:"},{"line_number":77,"context_line":"                polling_task \u003d self.polling_tasks.get("},{"line_number":78,"context_line":"                    pipeline.interval,"},{"line_number":79,"context_line":"                    self.polling_task(self))"},{"line_number":80,"context_line":"                polling_task.add(pollster, counters, [pipeline])"},{"line_number":81,"context_line":"                self.polling_tasks[pipeline.interval] \u003d polling_task"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byyo%3D","line":79,"in_reply_to":"AAAAM3%2F%2B02A%3D","updated":"2013-02-21 02:00:58.000000000","message":"My fault, the polling_task is in fact a class object, will change it.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d036562fdcdbf07d4a79a41439bacf7c0885bb42","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        self.pollster_manager \u003d extension_manager"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        self.context \u003d context.RequestContext(\u0027admin\u0027, \u0027admin\u0027, is_admin\u003dTrue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Bsq4%3D","line":67,"updated":"2013-02-21 09:59:16.000000000","message":"Can\u0027t see where this is used, so I wonder if it\u0027s useful or if it belongs here.","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"6808f1e3af94c06e6fb3c5c44d59846a1e6630d2","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        self.pollster_manager \u003d extension_manager"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        self.context \u003d context.RequestContext(\u0027admin\u0027, \u0027admin\u0027, is_admin\u003dTrue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Bsos%3D","line":67,"in_reply_to":"AAAAM3%2F%2Bsq4%3D","updated":"2013-02-21 10:10:45.000000000","message":"Originally the AgentManager is invoked with a periodic task, which will provide the context. However, now we are no longer periodic task anymore, so we have to fetch the context ourselves.","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d036562fdcdbf07d4a79a41439bacf7c0885bb42","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        self.context \u003d context.RequestContext(\u0027admin\u0027, \u0027admin\u0027, is_admin\u003dTrue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    @abc.abstractmethod"},{"line_number":72,"context_line":"    def create_polling_task(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Bsq8%3D","line":69,"updated":"2013-02-21 09:59:16.000000000","message":"I don\u0027t think there\u0027s the need to store polling_tasks on self, so let\u0027s remove that and just have a function that return this once it\u0027s built.","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"f259ede14a06ab878dd40fda6d696666091d74f0","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        self.context \u003d context.RequestContext(\u0027admin\u0027, \u0027admin\u0027, is_admin\u003dTrue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    @abc.abstractmethod"},{"line_number":72,"context_line":"    def create_polling_task(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Bsh0%3D","line":69,"in_reply_to":"AAAAM3%2F%2Bsn0%3D","updated":"2013-02-21 11:13:02.000000000","message":"Done","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"226772a9d2d908f9134f840a23bf96b757005e3e","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        self.context \u003d context.RequestContext(\u0027admin\u0027, \u0027admin\u0027, is_admin\u003dTrue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    @abc.abstractmethod"},{"line_number":72,"context_line":"    def create_polling_task(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Bsn0%3D","line":69,"in_reply_to":"AAAAM3%2F%2BsoI%3D","updated":"2013-02-21 10:17:39.000000000","message":"I understand, my point is just to change setup_polling task in this way:\n\nFirst line: polling_tasks \u003d {}\nLast line: return polling_tasks\n\nSince there\u0027s no need, AFAIU, to store polling_tasks dict in the AgentManager","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"6808f1e3af94c06e6fb3c5c44d59846a1e6630d2","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        self.context \u003d context.RequestContext(\u0027admin\u0027, \u0027admin\u0027, is_admin\u003dTrue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        self.polling_tasks \u003d {}"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    @abc.abstractmethod"},{"line_number":72,"context_line":"    def create_polling_task(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2BsoI%3D","line":69,"in_reply_to":"AAAAM3%2F%2Bsq8%3D","updated":"2013-02-21 10:10:45.000000000","message":"The first time the polling_tasks is used is at setup_polling_tasks(), which will access it. Without this initialization, it will have error :$","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d036562fdcdbf07d4a79a41439bacf7c0885bb42","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"},{"line_number":80,"context_line":"                        if pipeline.support_counter(c)]"},{"line_number":81,"context_line":"            if counters:"},{"line_number":82,"context_line":"                polling_task \u003d self.polling_tasks.get(pipeline.interval, None)"},{"line_number":83,"context_line":"                if not polling_task:"},{"line_number":84,"context_line":"                    polling_task \u003d self.create_polling_task()"},{"line_number":85,"context_line":"                    self.polling_tasks[pipeline.interval] \u003d polling_task"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Bsq0%3D","line":82,"updated":"2013-02-21 09:59:16.000000000","message":"I think you can use a defaultdict here.","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"6808f1e3af94c06e6fb3c5c44d59846a1e6630d2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"},{"line_number":80,"context_line":"                        if pipeline.support_counter(c)]"},{"line_number":81,"context_line":"            if counters:"},{"line_number":82,"context_line":"                polling_task \u003d self.polling_tasks.get(pipeline.interval, None)"},{"line_number":83,"context_line":"                if not polling_task:"},{"line_number":84,"context_line":"                    polling_task \u003d self.create_polling_task()"},{"line_number":85,"context_line":"                    self.polling_tasks[pipeline.interval] \u003d polling_task"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2BsoY%3D","line":82,"in_reply_to":"AAAAM3%2F%2Bsq0%3D","updated":"2013-02-21 10:10:45.000000000","message":"I tried to use defaultdict in my first version, and really not fan of it , then change it this way. The reason is because get() will return None and that is error-prone.","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"402271a1b871171a74f1e370c29f391eee28ad90","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def add(self, pollster, counters, pipelines):"},{"line_number":43,"context_line":"        pollster_counters \u003d self.pollster_context.get(pollster, set([]))"},{"line_number":44,"context_line":"        self.publish_context.add_pipelines(pipelines)"},{"line_number":45,"context_line":"        pollster_counters.update(set(counters))"},{"line_number":46,"context_line":"        if pollster not in self.pollster_context:"},{"line_number":47,"context_line":"            self.pollster_context[pollster] \u003d pollster_counters"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsZw%3D","line":44,"updated":"2013-02-21 13:24:38.000000000","message":"If you rebase this one day, please invert the 2 first lines, it\u0027ll be easier to understand what the code does. Having add_pipeline in the middle confused me :)","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"227b5da43b9a94342f47df93cf130bccaf622480","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def add(self, pollster, counters, pipelines):"},{"line_number":43,"context_line":"        pollster_counters \u003d self.pollster_context.get(pollster, set([]))"},{"line_number":44,"context_line":"        self.publish_context.add_pipelines(pipelines)"},{"line_number":45,"context_line":"        pollster_counters.update(set(counters))"},{"line_number":46,"context_line":"        if pollster not in self.pollster_context:"},{"line_number":47,"context_line":"            self.pollster_context[pollster] \u003d pollster_counters"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsVM%3D","line":44,"in_reply_to":"AAAAM3%2F%2BsZw%3D","updated":"2013-02-21 14:08:03.000000000","message":"Done","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8a5bbe310e051a44575c846e434996b551b11a62","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def setup_polling_tasks(self):"},{"line_number":74,"context_line":"        polling_tasks \u003d {}"},{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2Bscs%3D","line":75,"updated":"2013-02-21 11:59:41.000000000","message":"I still don\u0027t understand why this is an O(n^2) loop. The counters returned by the pollsters don\u0027t change. Isn\u0027t it possible to build a dictionary so we only have to iterate over the list once?","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"976a2c2b306bdc3f10d177f52e0ae3bdfa551820","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def setup_polling_tasks(self):"},{"line_number":74,"context_line":"        polling_tasks \u003d {}"},{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsRo%3D","line":75,"in_reply_to":"AAAAM3%2F%2BsXY%3D","updated":"2013-02-21 14:47:37.000000000","message":"Ah, I see. We need to change the pipeline to expand its wildcards and negative counters to a list so it can return a list of the names of counters it supports, instead of depending on this method. Until we do that, we can\u0027t avoid looping like this. I have opened a blueprint so we can clean this up later (https://blueprints.launchpad.net/ceilometer/+spec/pipeline-configuration-cleanup).\n\nBTW, I was wrong in my analysis. This loop is O(n^3) because it asks each pollster for a list of counters and loops over those, too.","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"227b5da43b9a94342f47df93cf130bccaf622480","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def setup_polling_tasks(self):"},{"line_number":74,"context_line":"        polling_tasks \u003d {}"},{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsVE%3D","line":75,"in_reply_to":"AAAAM3%2F%2BsXY%3D","updated":"2013-02-21 14:08:03.000000000","message":"jd__, thanks for you explanation very much.","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"402271a1b871171a74f1e370c29f391eee28ad90","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def setup_polling_tasks(self):"},{"line_number":74,"context_line":"        polling_tasks \u003d {}"},{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsXY%3D","line":75,"in_reply_to":"AAAAM3%2F%2Bsbk%3D","updated":"2013-02-21 13:24:38.000000000","message":"Doug: yeah, we don\u0027t have much choice.\n\nWe need to iterate over each pipeline, and over each pollster of each pipeline.\nThen we need to check if one the counter generated by the pollster is supported by this pipeline. If that\u0027s the case, we add this pollster to the list of pollster to run.\n\nA pipeline don\u0027t have directly a list of pollster, it hasn\u0027t sense.\n\nI\u0027ve a made a quick schema so that helps to understand how it\u0027s organized:\n\nhttps://lh4.googleusercontent.com/-ceHo8H7CzRc/USYfW9V244I/AAAAAAABRSg/5Idd-LwxI7c/s992/20130221_142110.jpg","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"731aef6c22812981d3d0dcdac3a4f6ce13a931ee","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def setup_polling_tasks(self):"},{"line_number":74,"context_line":"        polling_tasks \u003d {}"},{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2Bsbk%3D","line":75,"in_reply_to":"AAAAM3%2F%2Bscs%3D","updated":"2013-02-21 12:12:00.000000000","message":"However, for each pollster, we need scan all pollster still, right? So even with the dictionary, the only benefit is we don\u0027t need invoke the get_counter_names(), that is cheap.","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"402271a1b871171a74f1e370c29f391eee28ad90","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"},{"line_number":79,"context_line":"                        if pipeline.support_counter(c)]"},{"line_number":80,"context_line":"            if counters:"},{"line_number":81,"context_line":"                polling_task \u003d polling_tasks.get(pipeline.interval, None)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsZo%3D","line":78,"updated":"2013-02-21 13:24:38.000000000","message":"I think it\u0027d simplify the logic a bit if you didn\u0027t take care of counter support here, since this is actually used nowhere.\nPatch simplifying is at https://github.com/jd/ceilometer/commit/01863fb686c57bf72d637080db6c28b6386e638f","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"227b5da43b9a94342f47df93cf130bccaf622480","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        for pipeline, pollster in itertools.product("},{"line_number":76,"context_line":"                self.pipeline_manager.pipelines,"},{"line_number":77,"context_line":"                self.pollster_manager.extensions):"},{"line_number":78,"context_line":"            counters \u003d [c for c in pollster.obj.get_counter_names()"},{"line_number":79,"context_line":"                        if pipeline.support_counter(c)]"},{"line_number":80,"context_line":"            if counters:"},{"line_number":81,"context_line":"                polling_task \u003d polling_tasks.get(pipeline.interval, None)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsSs%3D","line":78,"in_reply_to":"AAAAM3%2F%2BsZo%3D","updated":"2013-02-21 14:08:03.000000000","message":"Thanks for your patch.\n\nIt\u0027s ok to remove the counters since we don\u0027t use it. But in future, I think we can passing the counters to the pollster, so that pollster don\u0027t need poll all counters every time.","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d8bb4b86f58391c3816b0d947720d9bc5e15b1a1","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                    if not polling_task:"},{"line_number":79,"context_line":"                        polling_task \u003d self.create_polling_task()"},{"line_number":80,"context_line":"                        polling_tasks[pipeline.interval] \u003d polling_task"},{"line_number":81,"context_line":"                    polling_task.add(pollster, [pipeline])"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        return polling_tasks"},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAM3%2F%2BsDo%3D","line":81,"updated":"2013-02-21 16:25:15.000000000","message":"Ah I think it misses a break here!","commit_id":"4ff64947a3c38dc0fcdf4b3f1e29972db0377b6a"}],"ceilometer/central/manager.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"class PollingTask(agent.PollingTask):"},{"line_number":41,"context_line":"    def poll_and_publish(self):"},{"line_number":42,"context_line":"        \"\"\"Tasks to be run at a periodic interval.\"\"\""},{"line_number":43,"context_line":"        self.manager.keystone \u003d ksclient.Client("},{"line_number":44,"context_line":"            username\u003dcfg.CONF.os_username,"},{"line_number":45,"context_line":"            password\u003dcfg.CONF.os_password,"},{"line_number":46,"context_line":"            tenant_id\u003dcfg.CONF.os_tenant_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B01M%3D","line":43,"updated":"2013-02-18 14:04:50.000000000","message":"This method should not be modifying the manager by adding properties. The manager should provide one without this \"distant\" object instantiating it (what if some other distant object wants the manager, but it isn\u0027t created or that object creates it slightly differently?).","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":40,"context_line":"class PollingTask(agent.PollingTask):"},{"line_number":41,"context_line":"    def poll_and_publish(self):"},{"line_number":42,"context_line":"        \"\"\"Tasks to be run at a periodic interval.\"\"\""},{"line_number":43,"context_line":"        self.manager.keystone \u003d ksclient.Client("},{"line_number":44,"context_line":"            username\u003dcfg.CONF.os_username,"},{"line_number":45,"context_line":"            password\u003dcfg.CONF.os_password,"},{"line_number":46,"context_line":"            tenant_id\u003dcfg.CONF.os_tenant_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2ByyM%3D","line":43,"in_reply_to":"AAAAM3%2F%2B01M%3D","updated":"2013-02-21 02:00:58.000000000","message":"Done","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class AgentManager(agent.AgentManager):"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def __init__(self):"},{"line_number":68,"context_line":"        super(AgentManager, self).__init__("},{"line_number":69,"context_line":"            extension_manager.ActivatedExtensionManager("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B01g%3D","line":66,"updated":"2013-02-18 14:04:50.000000000","message":"Replace the \"polling_task\" instance attribute with a \"POLLING_TASK_FACTORY\" class attribute here.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class AgentManager(agent.AgentManager):"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def __init__(self):"},{"line_number":68,"context_line":"        super(AgentManager, self).__init__("},{"line_number":69,"context_line":"            extension_manager.ActivatedExtensionManager("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byx4%3D","line":66,"in_reply_to":"AAAAM3%2F%2B01g%3D","updated":"2013-02-21 02:00:58.000000000","message":"Added a abstract method to create polling task.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"}],"ceilometer/compute/manager.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class PollingTask(agent.PollingTask):"},{"line_number":45,"context_line":"    def poll_and_publish_instances(self, instances):"},{"line_number":46,"context_line":"        LOG.warning(\"poll and publish\")"},{"line_number":47,"context_line":"        with self.publish_context as publisher:"},{"line_number":48,"context_line":"            for instance in instances:"},{"line_number":49,"context_line":"                if getattr(instance, \u0027OS-EXT-STS:vm_state\u0027, None) !\u003d \u0027error\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B01I%3D","line":46,"updated":"2013-02-18 14:04:50.000000000","message":"LOG.debug()","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class PollingTask(agent.PollingTask):"},{"line_number":45,"context_line":"    def poll_and_publish_instances(self, instances):"},{"line_number":46,"context_line":"        LOG.warning(\"poll and publish\")"},{"line_number":47,"context_line":"        with self.publish_context as publisher:"},{"line_number":48,"context_line":"            for instance in instances:"},{"line_number":49,"context_line":"                if getattr(instance, \u0027OS-EXT-STS:vm_state\u0027, None) !\u003d \u0027error\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bx4Q%3D","line":46,"in_reply_to":"AAAAM3%2F%2B01I%3D","updated":"2013-02-21 02:00:58.000000000","message":"Left from my debug.Removed.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                    # polling all counters one by one"},{"line_number":52,"context_line":"                    for pollster in self.pollster_context.keys():"},{"line_number":53,"context_line":"                        try:"},{"line_number":54,"context_line":"                            LOG.warning(\"for pollster %s\", pollster)"},{"line_number":55,"context_line":"                            for c in pollster.obj.get_counters("},{"line_number":56,"context_line":"                                    self.manager,"},{"line_number":57,"context_line":"                                    instance):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B01A%3D","line":54,"updated":"2013-02-18 14:04:50.000000000","message":"LOG.debug()","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                    # polling all counters one by one"},{"line_number":52,"context_line":"                    for pollster in self.pollster_context.keys():"},{"line_number":53,"context_line":"                        try:"},{"line_number":54,"context_line":"                            LOG.warning(\"for pollster %s\", pollster)"},{"line_number":55,"context_line":"                            for c in pollster.obj.get_counters("},{"line_number":56,"context_line":"                                    self.manager,"},{"line_number":57,"context_line":"                                    instance):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bx4M%3D","line":54,"in_reply_to":"AAAAM3%2F%2B01A%3D","updated":"2013-02-21 02:00:58.000000000","message":"Left from my debug.Removed.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                            for c in pollster.obj.get_counters("},{"line_number":56,"context_line":"                                    self.manager,"},{"line_number":57,"context_line":"                                    instance):"},{"line_number":58,"context_line":"                                LOG.info(\u0027COUNTER: %s\u0027, c)"},{"line_number":59,"context_line":"                                publisher([c])"},{"line_number":60,"context_line":"                        except Exception as err:"},{"line_number":61,"context_line":"                            LOG.warning(\u0027Continue after error from %s: %s\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00s%3D","line":58,"updated":"2013-02-18 14:04:50.000000000","message":"LOG.debug()","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                            for c in pollster.obj.get_counters("},{"line_number":56,"context_line":"                                    self.manager,"},{"line_number":57,"context_line":"                                    instance):"},{"line_number":58,"context_line":"                                LOG.info(\u0027COUNTER: %s\u0027, c)"},{"line_number":59,"context_line":"                                publisher([c])"},{"line_number":60,"context_line":"                        except Exception as err:"},{"line_number":61,"context_line":"                            LOG.warning(\u0027Continue after error from %s: %s\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bx4I%3D","line":58,"in_reply_to":"AAAAM3%2F%2B00s%3D","updated":"2013-02-21 02:00:58.000000000","message":"We don\u0027t need this after use list for publisher(). Removed.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                                    self.manager,"},{"line_number":57,"context_line":"                                    instance):"},{"line_number":58,"context_line":"                                LOG.info(\u0027COUNTER: %s\u0027, c)"},{"line_number":59,"context_line":"                                publisher([c])"},{"line_number":60,"context_line":"                        except Exception as err:"},{"line_number":61,"context_line":"                            LOG.warning(\u0027Continue after error from %s: %s\u0027,"},{"line_number":62,"context_line":"                                        pollster.name, err)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00w%3D","line":59,"updated":"2013-02-18 14:04:50.000000000","message":"I\u0027m pretty sure that the point of having get_counters() return a list is that you can pass it directly to the publisher, instead of iterating over it yourself and then passing a list with one item in it.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                                    self.manager,"},{"line_number":57,"context_line":"                                    instance):"},{"line_number":58,"context_line":"                                LOG.info(\u0027COUNTER: %s\u0027, c)"},{"line_number":59,"context_line":"                                publisher([c])"},{"line_number":60,"context_line":"                        except Exception as err:"},{"line_number":61,"context_line":"                            LOG.warning(\u0027Continue after error from %s: %s\u0027,"},{"line_number":62,"context_line":"                                        pollster.name, err)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2ByxQ%3D","line":59,"in_reply_to":"AAAAM3%2F%2B00w%3D","updated":"2013-02-21 02:00:58.000000000","message":"This publishing has been counter-by-counter from very beginning, but yes, we can passing a list now.\nI will update it.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                            LOG.exception(err)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def poll_and_publish(self):"},{"line_number":66,"context_line":"        nv \u003d nova_client.Client()"},{"line_number":67,"context_line":"        self.poll_and_publish_instances("},{"line_number":68,"context_line":"            nv.instance_get_all_by_host(cfg.CONF.host))"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00o%3D","line":66,"updated":"2013-02-18 14:04:50.000000000","message":"Can this nova client be cached somewhere, like we do with the keystone client?","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                            LOG.exception(err)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def poll_and_publish(self):"},{"line_number":66,"context_line":"        nv \u003d nova_client.Client()"},{"line_number":67,"context_line":"        self.poll_and_publish_instances("},{"line_number":68,"context_line":"            nv.instance_get_all_by_host(cfg.CONF.host))"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2BymA%3D","line":66,"in_reply_to":"AAAAM3%2F%2B00o%3D","updated":"2013-02-21 02:00:58.000000000","message":"I change it to keep create nova client when manager initialized. This is a bit different with keystone client, which will be created on each polling. I think this is OK since nova client will contact with nova service each time when it try to list the servers and flavors.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            ),"},{"line_number":91,"context_line":"        )"},{"line_number":92,"context_line":"        self._inspector \u003d get_hypervisor_inspector()"},{"line_number":93,"context_line":"        self.polling_task \u003d PollingTask"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def setup_polling_tasks(self):"},{"line_number":96,"context_line":"        super(AgentManager, self).setup_polling_tasks()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B01c%3D","line":93,"updated":"2013-02-18 14:04:50.000000000","message":"See earlier comment about using a class attribute.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            ),"},{"line_number":91,"context_line":"        )"},{"line_number":92,"context_line":"        self._inspector \u003d get_hypervisor_inspector()"},{"line_number":93,"context_line":"        self.polling_task \u003d PollingTask"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def setup_polling_tasks(self):"},{"line_number":96,"context_line":"        super(AgentManager, self).setup_polling_tasks()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bx2o%3D","line":93,"in_reply_to":"AAAAM3%2F%2B01c%3D","updated":"2013-02-21 02:00:58.000000000","message":"Done with a create_polling_task().","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d036562fdcdbf07d4a79a41439bacf7c0885bb42","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                            LOG.exception(err)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def poll_and_publish(self):"},{"line_number":63,"context_line":"        self.poll_and_publish_instances("},{"line_number":64,"context_line":"            self.manager.nv.instance_get_all_by_host(cfg.CONF.host))"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2BsqE%3D","line":63,"updated":"2013-02-21 09:59:16.000000000","message":"Not sure that deserve 2 functions :)","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"6808f1e3af94c06e6fb3c5c44d59846a1e6630d2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                            LOG.exception(err)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def poll_and_publish(self):"},{"line_number":63,"context_line":"        self.poll_and_publish_instances("},{"line_number":64,"context_line":"            self.manager.nv.instance_get_all_by_host(cfg.CONF.host))"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2BsoQ%3D","line":63,"in_reply_to":"AAAAM3%2F%2BsqE%3D","updated":"2013-02-21 10:10:45.000000000","message":"The reason is the poll_instance() for nova notifier don\u0027t need write similar code, which only polling one instance.","commit_id":"e910cba5c01d9dc4b22d6030bfcb78762810b672"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8a5bbe310e051a44575c846e434996b551b11a62","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self._inspector \u003d get_hypervisor_inspector()"},{"line_number":89,"context_line":"        self.nv \u003d nova_client.Client()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def create_polling_task(self):"},{"line_number":92,"context_line":"        return PollingTask(self)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def setup_notifier_task(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2Bscg%3D","line":91,"updated":"2013-02-21 11:59:41.000000000","message":"Is this method used? In the next method you\u0027re instantiating PollingTask() directly. This method doesn\u0027t seem necessary, so I would prefer to remove it, rather than change setup_notifier_task().","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"976a2c2b306bdc3f10d177f52e0ae3bdfa551820","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self._inspector \u003d get_hypervisor_inspector()"},{"line_number":89,"context_line":"        self.nv \u003d nova_client.Client()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def create_polling_task(self):"},{"line_number":92,"context_line":"        return PollingTask(self)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def setup_notifier_task(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2BsPc%3D","line":91,"in_reply_to":"AAAAM3%2F%2Bsb8%3D","updated":"2013-02-21 14:47:37.000000000","message":"OK.","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"731aef6c22812981d3d0dcdac3a4f6ce13a931ee","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self._inspector \u003d get_hypervisor_inspector()"},{"line_number":89,"context_line":"        self.nv \u003d nova_client.Client()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def create_polling_task(self):"},{"line_number":92,"context_line":"        return PollingTask(self)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def setup_notifier_task(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAM3%2F%2Bsb8%3D","line":91,"in_reply_to":"AAAAM3%2F%2Bscg%3D","updated":"2013-02-21 12:12:00.000000000","message":"This will be invoked by the parent class.\nFor the followed code, since the setup_notifier_task() is locally code, so I don\u0027t use the create_polling_task(), instead instantiate the PollingTask directly.","commit_id":"2d77ddb0ca8da3678d29cd9700cdf7b332f8f4b3"}],"ceilometer/pipeline.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":67,"context_line":"class PublishContext(object):"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, context, source, pipelines\u003d[]):"},{"line_number":70,"context_line":"        self.pipelines \u003d set(pipelines)"},{"line_number":71,"context_line":"        self.context \u003d context"},{"line_number":72,"context_line":"        self.source \u003d source"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00U%3D","line":70,"updated":"2013-02-18 14:04:50.000000000","message":"Does the order the pipelines are processed make any difference? Why make this a set instead of a list?","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":67,"context_line":"class PublishContext(object):"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, context, source, pipelines\u003d[]):"},{"line_number":70,"context_line":"        self.pipelines \u003d set(pipelines)"},{"line_number":71,"context_line":"        self.context \u003d context"},{"line_number":72,"context_line":"        self.source \u003d source"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bylw%3D","line":70,"in_reply_to":"AAAAM3%2F%2B00U%3D","updated":"2013-02-21 02:00:58.000000000","message":"I don\u0027t think the pipeline order make any difference since all pipeline should be independent. Using set to avoid duplicated item adding.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        self.source \u003d source"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def add_pipelines(self, pipelines):"},{"line_number":75,"context_line":"        self.pipelines.update(set(pipelines))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def __enter__(self):"},{"line_number":78,"context_line":"        def p(counters):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00Y%3D","line":75,"updated":"2013-02-18 14:04:50.000000000","message":"If self.pipelines is already a set, you don\u0027t need to convert the argument pipelines to a set() before calling update. You can pass any iterable to update().","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        self.source \u003d source"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def add_pipelines(self, pipelines):"},{"line_number":75,"context_line":"        self.pipelines.update(set(pipelines))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def __enter__(self):"},{"line_number":78,"context_line":"        def p(counters):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byl0%3D","line":75,"in_reply_to":"AAAAM3%2F%2B00Y%3D","updated":"2013-02-21 02:00:58.000000000","message":"Done","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"}],"tests/agentbase.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return [self.test_data]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class TestPollsterExceptioin(TestPollster):"},{"line_number":42,"context_line":"    def get_counters(self, manager, instance):"},{"line_number":43,"context_line":"        print \"append\""},{"line_number":44,"context_line":"        print \"data name\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00Q%3D","line":41,"updated":"2013-02-18 14:04:50.000000000","message":"TestPollsterException (typo).","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return [self.test_data]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class TestPollsterExceptioin(TestPollster):"},{"line_number":42,"context_line":"    def get_counters(self, manager, instance):"},{"line_number":43,"context_line":"        print \"append\""},{"line_number":44,"context_line":"        print \"data name\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byls%3D","line":41,"in_reply_to":"AAAAM3%2F%2B00Q%3D","updated":"2013-02-21 02:00:58.000000000","message":"Done","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def setup_pipeline(self):"},{"line_number":73,"context_line":"        self.publisher \u003d self.PublisherClass()"},{"line_number":74,"context_line":"        self.publisher_manager \u003d dispatch.NameDispatchExtensionManager("},{"line_number":75,"context_line":"            \u0027fake\u0027,"},{"line_number":76,"context_line":"            check_func\u003dlambda x: True,"},{"line_number":77,"context_line":"            invoke_on_load\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00I%3D","line":74,"updated":"2013-02-18 14:04:50.000000000","message":"You may want to use a TestExtensionManager for tests, so you have more control over the extensions used. http://stevedore.readthedocs.org/en/latest/managers.html#testextensionmanager","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def setup_pipeline(self):"},{"line_number":73,"context_line":"        self.publisher \u003d self.PublisherClass()"},{"line_number":74,"context_line":"        self.publisher_manager \u003d dispatch.NameDispatchExtensionManager("},{"line_number":75,"context_line":"            \u0027fake\u0027,"},{"line_number":76,"context_line":"            check_func\u003dlambda x: True,"},{"line_number":77,"context_line":"            invoke_on_load\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bylg%3D","line":74,"in_reply_to":"AAAAM3%2F%2B00I%3D","updated":"2013-02-21 02:00:58.000000000","message":"The publisher manager is a NamedDispatchExtensionManager, which means it\u0027s map() implementation is different with TestExtensionManager, so we can\u0027t use the TestExtensionManager here.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            \u0027publishers\u0027: [\"test_pub\"],"},{"line_number":105,"context_line":"        }, ]"},{"line_number":106,"context_line":"        self.setup_pipeline()"},{"line_number":107,"context_line":"        self.mgr.pollster_manager.extensions \u003d ["},{"line_number":108,"context_line":"            extension.Extension(\u0027test\u0027,"},{"line_number":109,"context_line":"                                None,"},{"line_number":110,"context_line":"                                None,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00E%3D","line":107,"updated":"2013-02-18 14:04:50.000000000","message":"Using the TestExtensionManager would let you move this to the place where the manager is instantiated. Would that also let us stop patching setup_pipeline(), since the manager would be configured in the desired way?","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            \u0027publishers\u0027: [\"test_pub\"],"},{"line_number":105,"context_line":"        }, ]"},{"line_number":106,"context_line":"        self.setup_pipeline()"},{"line_number":107,"context_line":"        self.mgr.pollster_manager.extensions \u003d ["},{"line_number":108,"context_line":"            extension.Extension(\u0027test\u0027,"},{"line_number":109,"context_line":"                                None,"},{"line_number":110,"context_line":"                                None,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2ByWs%3D","line":107,"in_reply_to":"AAAAM3%2F%2B00E%3D","updated":"2013-02-21 02:00:58.000000000","message":"The pollster_manager is created internally by the corresponding manager, so we have to replace it later.\n\nThe patching to setup_pipeline() is to avoid the pipeline config file access, which will cause exception.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"}],"tests/central/test_manager.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        ]"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        super(TestRunTasks, self).setUp()"},{"line_number":58,"context_line":"        self.stubs.Set(ksclient, \u0027Client\u0027, lambda *args, **kwargs: None)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def tearDown(self):"},{"line_number":61,"context_line":"        super(TestRunTasks, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B00A%3D","line":58,"updated":"2013-02-18 14:04:50.000000000","message":"This looks like a good use of mock.patch() to replace Client with a mock instance instead of a lambda.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        ]"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        super(TestRunTasks, self).setUp()"},{"line_number":58,"context_line":"        self.stubs.Set(ksclient, \u0027Client\u0027, lambda *args, **kwargs: None)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def tearDown(self):"},{"line_number":61,"context_line":"        super(TestRunTasks, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Byic%3D","line":58,"in_reply_to":"AAAAM3%2F%2B00A%3D","updated":"2013-02-21 02:00:58.000000000","message":"The ksclient will be invoked on each test case, if use mock, seems we need mock each test case. With stub, we only need change it here.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"}],"tests/test_agent.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def setUp(self):"},{"line_number":52,"context_line":"        super(TestLoadPlugin, self).setUp()"},{"line_number":53,"context_line":"        self.ext_manager \u003d extension.ExtensionManager("},{"line_number":54,"context_line":"            \u0027fake\u0027,"},{"line_number":55,"context_line":"            invoke_on_load\u003dFalse,"},{"line_number":56,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B0z4%3D","line":53,"updated":"2013-02-18 14:04:50.000000000","message":"Use a TestExtensionManager","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self.mgr \u003d manager.AgentManager(self.ext_manager)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_load_pollster(self):"},{"line_number":62,"context_line":"        self.assertEqual(self.mgr.pollster_manager, self.ext_manager)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_load_pipelines(self):"},{"line_number":65,"context_line":"        assert self.mgr.pipeline_manager"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B0z0%3D","line":62,"updated":"2013-02-18 14:04:50.000000000","message":"This tests that the manager saves the value we give it. I don\u0027t think that\u0027s a very useful test. Is it meant to be doing more?","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"9693a5086bb786fb34f5815d7171ef13f90fca97","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self.mgr \u003d manager.AgentManager(self.ext_manager)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_load_pollster(self):"},{"line_number":62,"context_line":"        self.assertEqual(self.mgr.pollster_manager, self.ext_manager)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_load_pipelines(self):"},{"line_number":65,"context_line":"        assert self.mgr.pipeline_manager"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2Bx0M%3D","line":62,"in_reply_to":"AAAAM3%2F%2B0z0%3D","updated":"2013-02-21 02:00:58.000000000","message":"I removed the whole test_agent.py , since the agent.py is mainly a abstract class, and the working flow has been tested by the central manager and compute manager test code.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c341509ee3825b97b9d13151e9a29285c7b64a9b","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_load_pipelines(self):"},{"line_number":65,"context_line":"        assert self.mgr.pipeline_manager"},{"line_number":66,"context_line":"        self.assertTrue(len(self.mgr.pipeline_manager.pipelines) \u003d\u003d 1)"},{"line_number":67,"context_line":"        self.assertTrue([p for p in self.mgr.pipeline_manager.pipelines"},{"line_number":68,"context_line":"                        if p.support_counter(\u0027c1\u0027)])"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B0zw%3D","line":66,"updated":"2013-02-18 14:04:50.000000000","message":"Use assertEqual() to compare, it produces a better error message if the test fails.","commit_id":"94398c295216ae0fe5e1a72787fea320d0bd6bd7"}]}
