)]}'
{"osprofiler/drivers/elasticsearch_driver.py":[{"author":{"_account_id":21177,"name":"Sergey","email":"sbunatyan@mirantis.com","username":"sbunatyan"},"change_message_id":"37d85de468d43fc1acad4d05311e50254c441a95","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        info[\"service\"] \u003d self.service"},{"line_number":66,"context_line":"        self.client.index(index\u003dself.index_name, doc_type\u003dDOC_TYPE, body\u003dinfo)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def __hits(self, response):"},{"line_number":69,"context_line":"        scroll_id \u003d response[\"_scroll_id\"]"},{"line_number":70,"context_line":"        scroll_size \u003d len(response[\"hits\"][\"hits\"])"},{"line_number":71,"context_line":"        result \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_8ce41f0d","line":68,"updated":"2016-07-13 10:57:16.000000000","message":"Do you really need Double Underscore in the method name?","commit_id":"a7f81a6543a5b3206098c7810db57ad648ed66d7"},{"author":{"_account_id":21177,"name":"Sergey","email":"sbunatyan@mirantis.com","username":"sbunatyan"},"change_message_id":"37d85de468d43fc1acad4d05311e50254c441a95","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        :param base_id: Base id of trace elements."},{"line_number":104,"context_line":"        \"\"\""},{"line_number":105,"context_line":"        response \u003d self.client.search(index\u003dself.index_name, doc_type\u003dDOC_TYPE,"},{"line_number":106,"context_line":"                                      size\u003d10000,"},{"line_number":107,"context_line":"                                      body\u003d{\"query\": {"},{"line_number":108,"context_line":"                                          \"term\": {\"base_id\": base_id}}})"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_cca627aa","line":106,"range":{"start_line":106,"start_character":43,"end_line":106,"end_character":48},"updated":"2016-07-13 10:57:16.000000000","message":"May be it\u0027s better to move this value to some constant?","commit_id":"a7f81a6543a5b3206098c7810db57ad648ed66d7"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"3e3b85f4d2a20868ccb4fcd60a091ddf067854a2","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        info[\"project\"] \u003d self.project"},{"line_number":65,"context_line":"        info[\"service\"] \u003d self.service"},{"line_number":66,"context_line":"        self.client.index(index\u003dself.index_name, doc_type\u003dDOC_TYPE, body\u003dinfo)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_20782bf8","line":64,"updated":"2016-07-15 00:28:25.000000000","message":"Was it intentional to modify a callers dictionary?\n\nWhy not just copy the info object before modifying it?\n\n  info \u003d info.copy()\n  info[\"project\"] \u003d self.project\n  info[\"service\"] \u003d self.service\n\nAt least then u aren\u0027t modifying someone elses dict.","commit_id":"e260ef0ad9d03447f33d463d9730c2f3a6fda2f2"},{"author":{"_account_id":21765,"name":"Aleksandr Ignatev","email":"aignatyev@mirantis.com","username":"aignatyev"},"change_message_id":"194ada57270c2595e346394af5cc969c956cfebe","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        info[\"project\"] \u003d self.project"},{"line_number":65,"context_line":"        info[\"service\"] \u003d self.service"},{"line_number":66,"context_line":"        self.client.index(index\u003dself.index_name, doc_type\u003dDOC_TYPE, body\u003dinfo)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_74234306","line":64,"in_reply_to":"1aa78d24_20782bf8","updated":"2016-07-18 12:33:11.000000000","message":"Done","commit_id":"e260ef0ad9d03447f33d463d9730c2f3a6fda2f2"},{"author":{"_account_id":21765,"name":"Aleksandr Ignatev","email":"aignatyev@mirantis.com","username":"aignatyev"},"change_message_id":"e684da4292ec65b47a36208f5b0d030f3687350a","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        info[\"project\"] \u003d self.project"},{"line_number":65,"context_line":"        info[\"service\"] \u003d self.service"},{"line_number":66,"context_line":"        self.client.index(index\u003dself.index_name, doc_type\u003dDOC_TYPE, body\u003dinfo)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_bbc28a51","line":64,"in_reply_to":"1aa78d24_20782bf8","updated":"2016-07-15 01:03:22.000000000","message":"That\u0027s intentional. Adding fields to dictionary doesn\u0027t affect anything except subsequent calls, so creation of copy is unnecessary. Same is done for other backends like mongo/messaging queue.","commit_id":"e260ef0ad9d03447f33d463d9730c2f3a6fda2f2"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6fadf5c412ebc6ea996d2684116eedbc7222fe39","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from osprofiler.drivers import base"},{"line_number":17,"context_line":"from osprofiler import exc"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"DOC_TYPE \u003d \"notification\""},{"line_number":20,"context_line":"SCROLL_TIME \u003d \"2m\""},{"line_number":21,"context_line":"SCROLL_SIZE \u003d 10000"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class ElasticsearchDriver(base.Driver):"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_a1f36409","line":21,"range":{"start_line":19,"start_character":0,"end_line":21,"end_character":19},"updated":"2016-07-25 21:22:23.000000000","message":"should not this be configurable in the [profiler] *.conf section? Or somewhere else?","commit_id":"41a688047f56d00c803b552bf184189cc22afbb2"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"61626de7b5f05c1bc99f0936440ddc8c94fd80ac","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from osprofiler.drivers import base"},{"line_number":17,"context_line":"from osprofiler import exc"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"DOC_TYPE \u003d \"notification\""},{"line_number":20,"context_line":"SCROLL_TIME \u003d \"2m\""},{"line_number":21,"context_line":"SCROLL_SIZE \u003d 10000"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_7177983a","line":19,"updated":"2016-07-28 20:39:27.000000000","message":"again, should not these opts be a part of configuration file?","commit_id":"5c9ede7535df81e68f9c0136cc4dd225c2e4172d"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"154e1bd7d7f705738ebe920683ebfefc2c1b93a5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                \"\u0027elasticsearch\u0027 manually. Use command:\\n \""},{"line_number":38,"context_line":"                \"\u0027pip install elasticsearch\u0027.\")"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        self.client \u003d Elasticsearch(self.connection_str)"},{"line_number":41,"context_line":"        self.index_name \u003d index_name"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_f7dd3843","line":40,"updated":"2016-07-28 21:23:12.000000000","message":"btw, when I\u0027m trying to use the following connection string:\n\n\u0027elasticsearch://localhost:9200\u0027\n\nI finally fit the error in this line:\n\n2016-07-28 17:19:52.444 TRACE cinder Traceback (most recent call last):\n2016-07-28 17:19:52.444 TRACE cinder   File \"/usr/local/bin/cinder-api\", line 10, in \u003cmodule\u003e\n2016-07-28 17:19:52.444 TRACE cinder     sys.exit(main())\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/cinder/cinder/cmd/api.py\", line 61, in main\n2016-07-28 17:19:52.444 TRACE cinder     server \u003d service.WSGIService(\u0027osapi_volume\u0027)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/cinder/cinder/service.py\", line 501, in __init__\n2016-07-28 17:19:52.444 TRACE cinder     setup_profiler(name, self.host)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/cinder/cinder/service.py\", line 97, in setup_profiler\n2016-07-28 17:19:52.444 TRACE cinder     host\u003dhost\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/osprofiler/osprofiler/initializer.py\", line 40, in init_from_conf\n2016-07-28 17:19:52.444 TRACE cinder     host\u003dhost)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/osprofiler/osprofiler/notifier.py\", line 66, in create\n2016-07-28 17:19:52.444 TRACE cinder     **kwargs).notify\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/osprofiler/osprofiler/drivers/base.py\", line 42, in get_driver\n2016-07-28 17:19:52.444 TRACE cinder     return driver(connection_string, *args, **kwargs)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/opt/stack/osprofiler/osprofiler/drivers/elasticsearch_driver.py\", line 40, in __init__\n2016-07-28 17:19:52.444 TRACE cinder     self.client \u003d Elasticsearch(self.connection_str)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/client/__init__.py\", line 168, in __init__\n2016-07-28 17:19:52.444 TRACE cinder     self.transport \u003d transport_class(_normalize_hosts(hosts), **kwargs)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py\", line 112, in __init__\n2016-07-28 17:19:52.444 TRACE cinder     self.set_connections(hosts)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py\", line 165, in set_connections\n2016-07-28 17:19:52.444 TRACE cinder     connections \u003d map(_create_connection, hosts)\n2016-07-28 17:19:52.444 TRACE cinder   File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py\", line 162, in _create_connection\n2016-07-28 17:19:52.444 TRACE cinder     host[\u0027scheme\u0027], self.connection_class.__name__, self.connection_class.transport_schema\n2016-07-28 17:19:52.444 TRACE cinder ImproperlyConfigured: Scheme specified in connection (elasticsearch) is not the same as the connection class (Urllib3HttpConnection) specifies (http).\n\nthat\u0027s pretty expected from what do we expect connection string to start with and from what Elastisearch is expecting to see. How is it supposed to be used?","commit_id":"5c9ede7535df81e68f9c0136cc4dd225c2e4172d"},{"author":{"_account_id":22478,"name":"Benjamin VanHavermaet","email":"bvanhav@us.ibm.com","username":"bvanhav"},"change_message_id":"65eb687b8639116478763c726b6eb4aa2619cdaa","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ElasticsearchDriver(base.Driver):"},{"line_number":23,"context_line":"    def __init__(self, connection_str, index_name\u003d\"osprofiler-notifications\","},{"line_number":24,"context_line":"                 project\u003dNone, service\u003dNone, host\u003dNone, conf\u003dNone, **kwargs):"},{"line_number":25,"context_line":"        \"\"\"Elasticsearch driver for OSProfiler.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"        super(ElasticsearchDriver, self).__init__(connection_str,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_88b8a912","line":24,"range":{"start_line":24,"start_character":56,"end_line":24,"end_character":65},"updated":"2016-08-30 18:56:20.000000000","message":"This forces the user to pass in the conf arg, otherwise this will cause later operations to fail.\n\nSo this effectively breaks the osprofiler CLI for elasticsearch, meaning elasticsearch exhibits different behavior than the other drivers.","commit_id":"097fc010664e0d7f78a66b1548863a8a670e2e58"},{"author":{"_account_id":21765,"name":"Aleksandr Ignatev","email":"aignatyev@mirantis.com","username":"aignatyev"},"change_message_id":"a60f3d2fefb75cf4a5c12779f53817bb52732c34","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ElasticsearchDriver(base.Driver):"},{"line_number":23,"context_line":"    def __init__(self, connection_str, index_name\u003d\"osprofiler-notifications\","},{"line_number":24,"context_line":"                 project\u003dNone, service\u003dNone, host\u003dNone, conf\u003dNone, **kwargs):"},{"line_number":25,"context_line":"        \"\"\"Elasticsearch driver for OSProfiler.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"        super(ElasticsearchDriver, self).__init__(connection_str,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_c21b627f","line":24,"range":{"start_line":24,"start_character":56,"end_line":24,"end_character":65},"in_reply_to":"fa7ab95a_88b8a912","updated":"2016-08-30 23:15:45.000000000","message":"In the previous patchsets I\u0027ve tried to keep stuff like es_doc_type/scroll_time and so on as hardcoded constants, but was advised to move them to configuration file. If we don\u0027t force user to pass conf file from profiled service and we don\u0027t keep hardcoded constants how do we make sure that we get those values?","commit_id":"097fc010664e0d7f78a66b1548863a8a670e2e58"},{"author":{"_account_id":22478,"name":"Benjamin VanHavermaet","email":"bvanhav@us.ibm.com","username":"bvanhav"},"change_message_id":"e468c04042612424e3f15b4e373632f4bea8784e","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ElasticsearchDriver(base.Driver):"},{"line_number":23,"context_line":"    def __init__(self, connection_str, index_name\u003d\"osprofiler-notifications\","},{"line_number":24,"context_line":"                 project\u003dNone, service\u003dNone, host\u003dNone, conf\u003dNone, **kwargs):"},{"line_number":25,"context_line":"        \"\"\"Elasticsearch driver for OSProfiler.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"        super(ElasticsearchDriver, self).__init__(connection_str,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_6d4ee597","line":24,"range":{"start_line":24,"start_character":56,"end_line":24,"end_character":65},"in_reply_to":"fa7ab95a_c21b627f","updated":"2016-08-31 12:53:16.000000000","message":"My main concern was more that the OSProfiler CLI doesn\u0027t work, at least it didn\u0027t work when I tried it. So that\u0027s the issue I\u0027d like to see addressed.","commit_id":"097fc010664e0d7f78a66b1548863a8a670e2e58"},{"author":{"_account_id":22478,"name":"Benjamin VanHavermaet","email":"bvanhav@us.ibm.com","username":"bvanhav"},"change_message_id":"dc894404010bd5e788b13bb116ac70cf5222c5d0","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_config import cfg"},{"line_number":20,"context_line":"from osprofiler.drivers import base"},{"line_number":21,"context_line":"from osprofiler import exc"},{"line_number":22,"context_line":"from osprofiler.opts import set_defaults"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class ElasticsearchDriver(base.Driver):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_1de73241","line":22,"updated":"2016-08-31 18:12:31.000000000","message":"I found that having this import here, created a weird dependency case when importing OSProfiler into some of the other Openstack code. These dependencies would cause the import to fail (error message below). One option I tried (that seemed to work) was importing this conditionally in __init__ (moving it inside \"if conf is None:\"). However, there should be a better way then that.\n\n  File \"/opt/bbc/openstack-11.0-master/nova/local/lib/python2.7/site-packages/osprofiler/drivers/__init__.py\", line 1, in \u003cmodule\u003e\n    from osprofiler.drivers import base  # noqa\nImportError: cannot import name base","commit_id":"78b45116e49dd6fd4cd91b4c26a722bb487eed0d"},{"author":{"_account_id":22478,"name":"Benjamin VanHavermaet","email":"bvanhav@us.ibm.com","username":"bvanhav"},"change_message_id":"24f5978b27d7c7579913a962eff160d301a8005b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        client_url \u003d parser.urlunparse(parser.urlparse(self.connection_str)"},{"line_number":41,"context_line":"                                       ._replace(scheme\u003d\"http\"))"},{"line_number":42,"context_line":"        if conf is None:"},{"line_number":43,"context_line":"            conf \u003d cfg.CONF"},{"line_number":44,"context_line":"        self.conf \u003d conf"},{"line_number":45,"context_line":"        self.client \u003d Elasticsearch(client_url)"},{"line_number":46,"context_line":"        self.index_name \u003d index_name"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa7ab95a_914dbf9b","line":43,"updated":"2016-09-01 12:06:04.000000000","message":"This took care of the import problem, but in the case of the CLI the osprofiler.opts.set_defaults is never called. I think going forward, putting the data into the conf instead of hard coded values is the way to go, so I think the right solution would be to call the set_defaults as part of the CLI start up. That way it\u0027s loaded for future drivers (or modifications for other drivers) that depend on the config being there.","commit_id":"a5570798b2be8322c6374d066963647ac60121bd"}]}
