)]}'
{"osprofiler/profiler.py":[{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"b8a5b823ae3f3f518d04a0894a264f2c189ebc80","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def init(hmac_key, base_id\u003dNone, parent_id\u003dNone, connection_str\u003dNone,"},{"line_number":48,"context_line":"         project\u003dNone, service\u003dNone):"},{"line_number":49,"context_line":"    \"\"\"Init profiler instance for current thread."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    You should call profiler.init() before using osprofiler."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_5328ed84","side":"PARENT","line":48,"range":{"start_line":48,"start_character":9,"end_line":48,"end_character":35},"updated":"2017-06-22 02:03:18.000000000","message":"Actually, we used this for initializing rpc trace, example in [1] and [2].\n\n[1] https://github.com/openstack/nova/blob/72119868b27b293d5fa60c19392c0ba08e3df9b3/nova/rpc.py#L165\n[2] https://github.com/openstack/nova/blob/759ecdfb21ac0d2a6060a402667559eb937e40a2/nova/utils.py#L1029","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"},{"author":{"_account_id":5950,"name":"Ilya Shakhat","email":"shakhat@gmail.com","username":"shakhat"},"change_message_id":"86e840135f983d42d23d148e325dd0fccadbe2fa","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def init(hmac_key, base_id\u003dNone, parent_id\u003dNone, connection_str\u003dNone,"},{"line_number":48,"context_line":"         project\u003dNone, service\u003dNone):"},{"line_number":49,"context_line":"    \"\"\"Init profiler instance for current thread."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    You should call profiler.init() before using osprofiler."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_fa633819","side":"PARENT","line":48,"range":{"start_line":48,"start_character":9,"end_line":48,"end_character":35},"in_reply_to":"5f201791_5328ed84","updated":"2017-06-22 14:57:30.000000000","message":"In both places the code initializes profiler with data received from RPC channel. This data has trace info (hmac_key, base_id and trace_id) and has no project nor service.\n\nBasically profiler initialization is made to be too misleading (at least function names are). We have \"initialization\" of notifier and \"initialization\" of trace. The first happens when service starts up and requires conf parameters (e.g. connection_string). As result notifier contains a driver which knows about project, service and a host. Initialization of trace is performed in wsgi and rpc handlers. The data is extracted from request/context and contains current base_id and trace_id.","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"},{"author":{"_account_id":5950,"name":"Ilya Shakhat","email":"shakhat@gmail.com","username":"shakhat"},"change_message_id":"29390ffdb8579357996231794818cfc45c0c8708","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def init(hmac_key, base_id\u003dNone, parent_id\u003dNone, connection_str\u003dNone,"},{"line_number":48,"context_line":"         project\u003dNone, service\u003dNone):"},{"line_number":49,"context_line":"    \"\"\"Init profiler instance for current thread."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    You should call profiler.init() before using osprofiler."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_efb594ce","side":"PARENT","line":48,"range":{"start_line":48,"start_character":9,"end_line":48,"end_character":35},"in_reply_to":"5f201791_e3f023cc","updated":"2017-06-23 13:14:00.000000000","message":"Tovin, do you agree that init() function receives no \u0027project\u0027 nor \u0027service\u0027 values?","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"},{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"b4f6b98aa8e86c224bbce58df6887500fdee8448","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def init(hmac_key, base_id\u003dNone, parent_id\u003dNone, connection_str\u003dNone,"},{"line_number":48,"context_line":"         project\u003dNone, service\u003dNone):"},{"line_number":49,"context_line":"    \"\"\"Init profiler instance for current thread."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    You should call profiler.init() before using osprofiler."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_e3f023cc","side":"PARENT","line":48,"range":{"start_line":48,"start_character":9,"end_line":48,"end_character":35},"in_reply_to":"5f201791_fa633819","updated":"2017-06-23 01:05:16.000000000","message":"Agree that it\u0027s so confused.","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"},{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"b8a5b823ae3f3f518d04a0894a264f2c189ebc80","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    __local_ctx.profiler \u003d _Profiler(hmac_key, base_id\u003dbase_id,"},{"line_number":64,"context_line":"                                     parent_id\u003dparent_id,"},{"line_number":65,"context_line":"                                     connection_str\u003dconnection_str,"},{"line_number":66,"context_line":"                                     project\u003dproject, service\u003dservice)"},{"line_number":67,"context_line":"    return __local_ctx.profiler"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_b33861d3","side":"PARENT","line":65,"range":{"start_line":65,"start_character":37,"end_line":65,"end_character":66},"updated":"2017-06-22 02:03:18.000000000","message":"But, this is not used anywhere (as I know).\n\n@Vipin: Can you re-check this?","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"53b02c6c9bc674ffbf1958f961bfd1eed33b0492","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    __local_ctx.profiler \u003d _Profiler(hmac_key, base_id\u003dbase_id,"},{"line_number":64,"context_line":"                                     parent_id\u003dparent_id,"},{"line_number":65,"context_line":"                                     connection_str\u003dconnection_str,"},{"line_number":66,"context_line":"                                     project\u003dproject, service\u003dservice)"},{"line_number":67,"context_line":"    return __local_ctx.profiler"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_01618905","side":"PARENT","line":65,"range":{"start_line":65,"start_character":37,"end_line":65,"end_character":66},"in_reply_to":"5f201791_b33861d3","updated":"2017-06-26 23:44:46.000000000","message":"Profiler uses a notifier and only the notifier should know the connection string. So we can remove it. I\u0027ve asked this question before.\n\nSee https://review.openstack.org/#/c/247005/35/osprofiler/profiler.py\n\nI think the plan then was to use the driver as a Profiler instance variable.","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"}],"osprofiler/tests/functional/test_driver.py":[{"author":{"_account_id":5950,"name":"Ilya Shakhat","email":"shakhat@gmail.com","username":"shakhat"},"change_message_id":"3f7e3a51212290929c013b2aadfbdc27a7bfcaab","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        exp_raw_info \u003d {\"project\": self.PROJECT,"},{"line_number":65,"context_line":"                        \"service\": self.SERVICE}"},{"line_number":66,"context_line":"        raw_start \u003d child[\"info\"][\"meta.raw_payload.%s-start\" % name]"},{"line_number":67,"context_line":"        self._assert_dict(raw_start[\"info\"], **exp_raw_info)"},{"line_number":68,"context_line":"        self.assertEqual(fn_name, raw_start[\"info\"][\"function\"][\"name\"])"},{"line_number":69,"context_line":"        exp_raw \u003d {\"name\": \"%s-start\" % name,"},{"line_number":70,"context_line":"                   \"service\": self.SERVICE,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_efbb94e2","side":"PARENT","line":67,"updated":"2017-07-31 13:55:44.000000000","message":"this is true only here, because \"project\" and \"service\" are passed explicitly on line 84; but it is never a case in production","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"},{"author":{"_account_id":5950,"name":"Ilya Shakhat","email":"shakhat@gmail.com","username":"shakhat"},"change_message_id":"4d88f6c814790369b1e935533c210b332aef5847","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        exp_raw_info \u003d {\"project\": self.PROJECT,"},{"line_number":65,"context_line":"                        \"service\": self.SERVICE}"},{"line_number":66,"context_line":"        raw_start \u003d child[\"info\"][\"meta.raw_payload.%s-start\" % name]"},{"line_number":67,"context_line":"        self._assert_dict(raw_start[\"info\"], **exp_raw_info)"},{"line_number":68,"context_line":"        self.assertEqual(fn_name, raw_start[\"info\"][\"function\"][\"name\"])"},{"line_number":69,"context_line":"        exp_raw \u003d {\"name\": \"%s-start\" % name,"},{"line_number":70,"context_line":"                   \"service\": self.SERVICE,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_dbd77223","side":"PARENT","line":67,"updated":"2017-07-31 16:00:28.000000000","message":"this is true only here, because \"project\" and \"service\" are passed explicitly on line 84; but it is never a case in production","commit_id":"cffca4e29e373e3f09f2ffdd458761183a851569"}]}
