)]}'
{"monasca_persister/tools/influxdb/db-per-tenant/README.rst":[{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"de397b98945578a7f9139b8ab8163dfec55934f3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7faddb67_5c519361","updated":"2019-09-03 14:59:43.000000000","message":"I\u0027d rather add it to https://opendev.org/openstack/monasca-api/src/branch/master/doc/source/admin/index.rst to get it published to docs.openstack.org\n\nWe could keep here the reference to the published document.","commit_id":"7b859b69dd62f4a6ebebf50ba4d86c775538df0c"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"9acc701dd14a4b0de4fe2b42b886d42f9b57b68e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"migrate-to-db-per-tenant.py"},{"line_number":2,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"The general plan for the monasca project is to move in the direction of"},{"line_number":5,"context_line":"having a database per tenant as that will not only give a finer grain"},{"line_number":6,"context_line":"control over retention policy per tenant but also possibly speed up"},{"line_number":7,"context_line":"tenants queries by scoping them within the project."}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_870c023c","line":4,"updated":"2019-09-10 09:38:55.000000000","message":"Other benefits:\n\n\u003e Security is improved. (For example, a previous bug in InfluxDB where the tenant ID was ignored in the query exposed data from outside a tenants project. This is less likely to happen with a separate DB per tenant.)\n\n\u003e We move in a direction of improving scalability for InfluxDB users without the Enterprise license. In the future a dedicated InfluxDB instance could optionally be used per project.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":1,"context_line":"migrate-to-db-per-tenant.py"},{"line_number":2,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"The general plan for the monasca project is to move in the direction of"},{"line_number":5,"context_line":"having a database per tenant as that will not only give a finer grain"},{"line_number":6,"context_line":"control over retention policy per tenant but also possibly speed up"},{"line_number":7,"context_line":"tenants queries by scoping them within the project."}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_961195af","line":4,"in_reply_to":"5faad753_870c023c","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"- Identify installation path to monasca-persister.  This may be a"},{"line_number":23,"context_line":"  virtual environment such as"},{"line_number":24,"context_line":"  `/opt/stack/venv/monasca-\u003cversion\u003e/lib/python2.7/site-packages/monasca_persister`"},{"line_number":25,"context_line":"  or as in devstack"},{"line_number":26,"context_line":"  `/opt/stack/monasca-persister/monasca_persister/`."},{"line_number":27,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_c2874861","line":24,"updated":"2019-09-10 11:18:28.000000000","message":"Can we make it an explicit step to run it in a monasca persister venv? I know that\u0027s what you do implicitly below, but spelling it out might help avoid people running it without one.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"- Identify installation path to monasca-persister.  This may be a"},{"line_number":23,"context_line":"  virtual environment such as"},{"line_number":24,"context_line":"  `/opt/stack/venv/monasca-\u003cversion\u003e/lib/python2.7/site-packages/monasca_persister`"},{"line_number":25,"context_line":"  or as in devstack"},{"line_number":26,"context_line":"  `/opt/stack/monasca-persister/monasca_persister/`."},{"line_number":27,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_760e598e","line":24,"in_reply_to":"5faad753_c2874861","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"9acc701dd14a4b0de4fe2b42b886d42f9b57b68e","unresolved":false,"context_lines":[{"line_number":31,"context_line":"  or in devstack"},{"line_number":32,"context_line":"  `/etc/monasca/persister.conf`"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"- Invoke the tool to migrate to database per tenant."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"::"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_672226a7","line":34,"updated":"2019-09-10 09:38:55.000000000","message":"Make a backup before this?! :)","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":31,"context_line":"  or in devstack"},{"line_number":32,"context_line":"  `/etc/monasca/persister.conf`"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"- Invoke the tool to migrate to database per tenant."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"::"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_f621e9fc","line":34,"in_reply_to":"5faad753_672226a7","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"9acc701dd14a4b0de4fe2b42b886d42f9b57b68e","unresolved":false,"context_lines":[{"line_number":34,"context_line":"- Invoke the tool to migrate to database per tenant."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"::"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"   sudo -u mon-persister /opt/stack/venv/monasca-\u003cversion\u003e/bin/python migrate-to-db-per-tenant.py --config-file /etc/monasca/persister.conf"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_67f3060c","line":37,"updated":"2019-09-10 09:38:55.000000000","message":"If I pretend I don\u0027t know anything about this tool I would like to know the answers to the following questions:\n\n1. Will this interrupt the operation of Monasca? \n2. How do I ensure that I migrate *all* metrics to the new scheme? I.e. I need to stop all persisters writing to InfluxDB and let Kafka buffer for a bit right?\n3. Will the original index be left intact so that I can fall back if it doesn\u0027t work?\n4. What do I do after I have run the tool? I need to enable the feature before starting the persisters right?\n5. How long does it take (rough estimate per GB of metrics?)\n6. Is the tool idempotent? I.e. could I migrate the bulk of the data with the persisters running, stop the persisters, and then migrate the delta in a short interval to minimise downtime? Can I run it again if it fails?\n7. Will it set fire to my cat?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":34,"context_line":"- Invoke the tool to migrate to database per tenant."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"::"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"   sudo -u mon-persister /opt/stack/venv/monasca-\u003cversion\u003e/bin/python migrate-to-db-per-tenant.py --config-file /etc/monasca/persister.conf"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5faad753_79cc0abc","line":37,"in_reply_to":"5faad753_67f3060c","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":4,"context_line":"The general plan for the monasca project is to move in the direction of"},{"line_number":5,"context_line":"having a database per tenant because:"},{"line_number":6,"context_line":"- Not only give a finer grain control over retention policy per tenant"},{"line_number":7,"context_line":"  but also possibly speed up tenants queries by scoping them within the"},{"line_number":8,"context_line":"  project."},{"line_number":9,"context_line":"- Security is improved. (For example, a previous bug in InfluxDB where"},{"line_number":10,"context_line":"  the tenant ID was ignored in the query exposed data from outside a"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_342f6240","line":7,"range":{"start_line":7,"start_character":68,"end_line":7,"end_character":71},"updated":"2019-09-11 08:57:01.000000000","message":"nit: s/the/their","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":6,"context_line":"- Not only give a finer grain control over retention policy per tenant"},{"line_number":7,"context_line":"  but also possibly speed up tenants queries by scoping them within the"},{"line_number":8,"context_line":"  project."},{"line_number":9,"context_line":"- Security is improved. (For example, a previous bug in InfluxDB where"},{"line_number":10,"context_line":"  the tenant ID was ignored in the query exposed data from outside a"},{"line_number":11,"context_line":"  tenants project. This is less likely to happen with a separate DB per"},{"line_number":12,"context_line":"  tenant.)"},{"line_number":13,"context_line":"- We move in a direction of improving scalability for InfluxDB users"},{"line_number":14,"context_line":"  without the Enterprise license. In the future a dedicated InfluxDB"},{"line_number":15,"context_line":"  instance could optionally be used per project."}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_94ec16f4","line":12,"range":{"start_line":9,"start_character":2,"end_line":12,"end_character":10},"updated":"2019-09-11 08:57:01.000000000","message":"Maybe just say `Security is improved through better isolation`?","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"  or as in devstack"},{"line_number":34,"context_line":"  `/opt/stack/monasca-persister/monasca_persister/`."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"- Source the virtual environmnent identified above."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"- Identify the existing configuration for monasca-persister. If using a"},{"line_number":39,"context_line":"  java deployment, it may be in"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_b4a3529e","line":36,"range":{"start_line":36,"start_character":2,"end_line":36,"end_character":20},"updated":"2019-09-11 08:57:01.000000000","message":"Above it says it *may* be installed in a venv, so here we could just say `If Monasca Persister is installed in a venv activate it`?","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"  or as in devstack"},{"line_number":34,"context_line":"  `/opt/stack/monasca-persister/monasca_persister/`."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"- Source the virtual environmnent identified above."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"- Identify the existing configuration for monasca-persister. If using a"},{"line_number":39,"context_line":"  java deployment, it may be in"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_949ad66b","line":36,"range":{"start_line":36,"start_character":21,"end_line":36,"end_character":33},"updated":"2019-09-11 08:57:01.000000000","message":"typo","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"- Identify the existing configuration for monasca-persister. If using a"},{"line_number":39,"context_line":"  java deployment, it may be in"},{"line_number":40,"context_line":"  `/opt/stack/service/monasca/etc/persister-config.yml`"},{"line_number":41,"context_line":"  or in devstack"},{"line_number":42,"context_line":"  `/etc/monasca/persister.conf`"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_d4ccce62","line":40,"range":{"start_line":40,"start_character":2,"end_line":40,"end_character":55},"updated":"2019-09-11 08:57:01.000000000","message":"I don\u0027t think the tool is going to support using this? You could just say create a python config file from your Java file if using Java (minority of people).","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":42,"context_line":"  `/etc/monasca/persister.conf`"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"- Optionally, make a backup of your database in case something goes"},{"line_number":45,"context_line":"  wrong but your original database in theory should be left intact."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"- Open and edit `migrate-to-db-per-tenant.py` and edit mapping between"},{"line_number":48,"context_line":"  your existing projects to retention policies if you so wish. You may"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_b4fa7272","line":45,"range":{"start_line":45,"start_character":35,"end_line":45,"end_character":51},"updated":"2019-09-11 08:57:01.000000000","message":"this doesn\u0027t leave me with much confidence! remove `in theory`? as you say, it *should* work.","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":62,"context_line":"FAQ"},{"line_number":63,"context_line":"\u003d\u003d\u003d"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"1. Will this interrupt the operation of Monasca? "},{"line_number":66,"context_line":"-  In theory, you can run this migration query on a live Monasca system"},{"line_number":67,"context_line":"   because the migration leaves the original database untouched."},{"line_number":68,"context_line":"   However, in practice, it may degrade performance while the migration"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_94f9764e","line":65,"range":{"start_line":65,"start_character":48,"end_line":65,"end_character":49},"updated":"2019-09-11 08:57:01.000000000","message":"nit: remove","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":86,"context_line":"   be best to switch this feature on after the first round of migration,"},{"line_number":87,"context_line":"   restart the persister so that it starts writing to database per"},{"line_number":88,"context_line":"   tenancy and migrate the remainder of the data. Note that in the"},{"line_number":89,"context_line":"   second run, delete `migrate-success.log` may need to be delete and"},{"line_number":90,"context_line":"   you may also want to redefine `default_end_time_offset` to a value"},{"line_number":91,"context_line":"   larger that the length of time the first back of migration took to"},{"line_number":92,"context_line":"   complete."},{"line_number":93,"context_line":"5. How long does it take (rough estimate per GB of metrics?)"},{"line_number":94,"context_line":"-  This depends on your storage backend. On one of the systems in which"},{"line_number":95,"context_line":"   we ran this tool, it was an overnight job to move 40GB of metrics."}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_34bf6262","line":92,"range":{"start_line":89,"start_character":59,"end_line":92,"end_character":12},"updated":"2019-09-11 08:57:01.000000000","message":"a bunch of typos in here","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":91,"context_line":"   larger that the length of time the first back of migration took to"},{"line_number":92,"context_line":"   complete."},{"line_number":93,"context_line":"5. How long does it take (rough estimate per GB of metrics?)"},{"line_number":94,"context_line":"-  This depends on your storage backend. On one of the systems in which"},{"line_number":95,"context_line":"   we ran this tool, it was an overnight job to move 40GB of metrics."},{"line_number":96,"context_line":"6. Is the tool idempotent? i.e. could I migrate the bulk of the data"},{"line_number":97,"context_line":"   with the persisters running, stop the persisters, and then migrate"},{"line_number":98,"context_line":"   the delta in a short interval to minimise downtime? Can I run it"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5faad753_344d229a","line":95,"range":{"start_line":94,"start_character":41,"end_line":95,"end_character":69},"updated":"2019-09-11 08:57:01.000000000","message":"It won\u0027t be obvious who \u0027We\u0027 is to the reader.","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":14123,"name":"Stefano Canepa","email":"sc@linux.it","username":"sc"},"change_message_id":"7bf542eb0ca15626e2035226c3844bc5ad375802","unresolved":false,"context_lines":[{"line_number":40,"context_line":"- Optionally, make a backup of your database in case something goes"},{"line_number":41,"context_line":"  wrong but your original database should be left intact."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"- Open and edit `migrate-to-db-per-tenant.py` and edit mapping between"},{"line_number":44,"context_line":"  your existing projects to retention policies if you so wish. You may"},{"line_number":45,"context_line":"  also want to change `default_end_time_offset` to the length of history"},{"line_number":46,"context_line":"  you want the migration tool to consider."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"- Invoke the tool to migrate to database per tenant."},{"line_number":49,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"3fa7e38b_a0a1eaab","line":46,"range":{"start_line":43,"start_character":1,"end_line":46,"end_character":42},"updated":"2019-09-19 15:34:46.000000000","message":"May these parameters be moved to a config file? May we run the app with multiple config? If you prefer to stick with changes in .py file please highlight them, I was unable to find what to do.","commit_id":"9f3dcbcdd2dd5888b21a88747d20e8a25264fbf3"}],"monasca_persister/tools/influxdb/db-per-tenant/migrate-to-db-per-tenant.py":[{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"unit \u003d \u0027d\u0027"},{"line_number":27,"context_line":"mult \u003d dict(w\u003d1, d\u003d7)"},{"line_number":28,"context_line":"rp_2w \u003d dict(end\u003d(mult[unit] * 2),"},{"line_number":29,"context_line":"             rp\u003ddict(name\u003d\u00272w\u0027, duration\u003d\u00272w\u0027, replication\u003d\u00271\u0027, default\u003dTrue))"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"migrate_query_template \u003d (\u0027SELECT * INTO \"{target_db}\"..:MEASUREMENT\u0027"},{"line_number":32,"context_line":"                          \u0027 FROM \"{measurement}\"\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_82d4f0be","line":29,"range":{"start_line":27,"start_character":0,"end_line":29,"end_character":78},"updated":"2019-09-10 11:18:28.000000000","message":"It would be nice if these had more informative variables names, or at the very least a comment explaining what they do. Please also make constants uppercase.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"unit \u003d \u0027d\u0027"},{"line_number":27,"context_line":"mult \u003d dict(w\u003d1, d\u003d7)"},{"line_number":28,"context_line":"rp_2w \u003d dict(end\u003d(mult[unit] * 2),"},{"line_number":29,"context_line":"             rp\u003ddict(name\u003d\u00272w\u0027, duration\u003d\u00272w\u0027, replication\u003d\u00271\u0027, default\u003dTrue))"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"migrate_query_template \u003d (\u0027SELECT * INTO \"{target_db}\"..:MEASUREMENT\u0027"},{"line_number":32,"context_line":"                          \u0027 FROM \"{measurement}\"\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_a581f14c","line":29,"range":{"start_line":27,"start_character":0,"end_line":29,"end_character":78},"in_reply_to":"5faad753_82d4f0be","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    migrate-to-db-per-tenant.py [-h] --config-file \u003cini\u003e"},{"line_number":49,"context_line":"        -h --help           Prints this"},{"line_number":50,"context_line":"        --config-file \u003cini\u003e (Required) Configuration file as described in README.rst"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    Example:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_6200d468","line":50,"updated":"2019-09-10 11:18:28.000000000","message":"This appears as an optional argument in the help, and the above test isn\u0027t included:\n\n```\n(tmp) [root@oldcranky monasca-persister]# python monasca_persister/tools/influxdb/db-per-tenant/migrate-to-db-per-tenant.py --help\nusage: [\u0027--help\u0027] [-h] [--config-dir DIR] [--config-file PATH] [--debug]\n                  [--log-config-append PATH] [--log-date-format DATE_FORMAT]\n                  [--log-dir LOG_DIR] [--log-file PATH] [--nodebug]\n                  [--nouse-journal] [--nouse-json] [--nouse-syslog]\n                  [--nowatch-log-file]\n                  [--syslog-log-facility SYSLOG_LOG_FACILITY] [--use-journal]\n                  [--use-json] [--use-syslog] [--version] [--watch-log-file]\n\nPersists metrics \u0026 alarm history in TSDB\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --config-dir DIR      Path to a config directory to pull `*.conf` files\n                        from. This file set is sorted, so as to provide a\n                        predictable parse order if individual options are\n                        over-ridden. The set is parsed after the file(s)\n                        specified via previous --config-file, arguments hence\n                        over-ridden options in the directory take precedence.\n                        This option must be set from the command-line.\n  --config-file PATH    Path to a config file to use. Multiple config files\n                        can be specified, with values in later files taking\n                        precedence. Defaults to None. This option must be set\n                        from the command-line.\n\n\n```","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    migrate-to-db-per-tenant.py [-h] --config-file \u003cini\u003e"},{"line_number":49,"context_line":"        -h --help           Prints this"},{"line_number":50,"context_line":"        --config-file \u003cini\u003e (Required) Configuration file as described in README.rst"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    Example:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_c54c2da0","line":50,"in_reply_to":"5faad753_6200d468","updated":"2019-09-10 14:29:02.000000000","message":"Yes I see the same, I took this from the cassandra tool... I guess it mainly for reference and not supposed to produce a help message. I will remove it.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    Example:"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    migrate-to-db-per-tenant.py --config-file \u003cpath\u003e/persister.ini"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    print(usage)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_422038b1","line":54,"updated":"2019-09-10 11:18:28.000000000","message":"I did the following to run it for reference:\n\ngit clone https://github.com/openstack/monasca-persister.git\ngit fetch https://review.opendev.org/openstack/monasca-persister refs/changes/94/679794/5 \u0026\u0026 git checkout FETCH_HEAD\ncd monasca-persister\nvirtualenv tmp\nsource tmp/bin/activate\npip install .\npip install influxdb (wasn\u0027t pulled in for some reason)\nsudo docker stop monasca_persister\npython monasca_persister/tools/influxdb/db-per-tenant/migrate-to-db-per-tenant.py --config-file /etc/kolla/monasca-persister/persister.conf\nEnable db_per_tenant in monasca-api and monasca-persister log files\nRestart monasca-api and monasca-persister","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                        f.write(r + \u0027\\n\u0027)"},{"line_number":128,"context_line":"        return measurements"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def get_tenancy(self, measurements):"},{"line_number":131,"context_line":"        result \u003d self.client.query(\"SHOW TAG VALUES WITH KEY \u003d _tenant_id\")"},{"line_number":132,"context_line":"        return {m: [t.get(\u0027value\u0027) for t in result.get_points(m)] for m in measurements}"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_36dd4170","line":130,"range":{"start_line":130,"start_character":12,"end_line":130,"end_character":19},"updated":"2019-09-10 11:18:28.000000000","message":"tenancies?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                        f.write(r + \u0027\\n\u0027)"},{"line_number":128,"context_line":"        return measurements"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def get_tenancy(self, measurements):"},{"line_number":131,"context_line":"        result \u003d self.client.query(\"SHOW TAG VALUES WITH KEY \u003d _tenant_id\")"},{"line_number":132,"context_line":"        return {m: [t.get(\u0027value\u0027) for t in result.get_points(m)] for m in measurements}"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_807063a7","line":130,"range":{"start_line":130,"start_character":12,"end_line":130,"end_character":19},"in_reply_to":"5faad753_36dd4170","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def migrate(self,"},{"line_number":142,"context_line":"                tenant_defaults\u003d{},"},{"line_number":143,"context_line":"                default_end_time_offset\u003d(52 * 5),"},{"line_number":144,"context_line":"                default_start_time_offset\u003d0,"},{"line_number":145,"context_line":"                skip_functions\u003d[],"},{"line_number":146,"context_line":"                measurements_file\u003dNone, success_file\u003dNone, failure_file\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_b6285186","line":143,"range":{"start_line":143,"start_character":41,"end_line":143,"end_character":47},"updated":"2019-09-10 11:18:28.000000000","message":"Why this? The code becomes easier to read if magic numbers are defined as constants with some descriptive name.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def migrate(self,"},{"line_number":142,"context_line":"                tenant_defaults\u003d{},"},{"line_number":143,"context_line":"                default_end_time_offset\u003d(52 * 5),"},{"line_number":144,"context_line":"                default_start_time_offset\u003d0,"},{"line_number":145,"context_line":"                skip_functions\u003d[],"},{"line_number":146,"context_line":"                measurements_file\u003dNone, success_file\u003dNone, failure_file\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_606527e1","line":143,"range":{"start_line":143,"start_character":41,"end_line":143,"end_character":47},"in_reply_to":"5faad753_b6285186","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            if os.path.exists(failure_file):"},{"line_number":154,"context_line":"                os.remove(failure_file)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        todo \u003d []"},{"line_number":157,"context_line":"        for measurement in measurements:"},{"line_number":158,"context_line":"            if any([f(measurement) for f in skip_functions]):"},{"line_number":159,"context_line":"                skip.add(measurement)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_36c6a19c","line":156,"range":{"start_line":156,"start_character":8,"end_line":156,"end_character":12},"updated":"2019-09-10 11:18:28.000000000","message":"filtered_measurements might be clearer?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        todo \u003d []"},{"line_number":157,"context_line":"        for measurement in measurements:"},{"line_number":158,"context_line":"            if any([f(measurement) for f in skip_functions]):"},{"line_number":159,"context_line":"                skip.add(measurement)"},{"line_number":160,"context_line":"                continue"},{"line_number":161,"context_line":"            elif measurement in done:"},{"line_number":162,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_d63aad96","line":159,"updated":"2019-09-10 11:18:28.000000000","message":"Log the skips so that people know that it\u0027s doing what it expects?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"75127b597e4cd772f848616fb7165cb9ec19753a","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        todo \u003d []"},{"line_number":157,"context_line":"        for measurement in measurements:"},{"line_number":158,"context_line":"            if any([f(measurement) for f in skip_functions]):"},{"line_number":159,"context_line":"                skip.add(measurement)"},{"line_number":160,"context_line":"                continue"},{"line_number":161,"context_line":"            elif measurement in done:"},{"line_number":162,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_16fe05ae","line":159,"in_reply_to":"5faad753_d63aad96","updated":"2019-09-10 11:19:26.000000000","message":"*doing what they expect","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def main():"},{"line_number":196,"context_line":"    default_end_time_offset \u003d mult[unit] * 52 * 5  # 5 years"},{"line_number":197,"context_line":"    tenant_defaults \u003d {"},{"line_number":198,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp_2w,"},{"line_number":199,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_363c61c7","line":196,"range":{"start_line":196,"start_character":43,"end_line":196,"end_character":49},"updated":"2019-09-10 11:18:28.000000000","message":"Appears above, could be a constant. Why 5 years?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def main():"},{"line_number":196,"context_line":"    default_end_time_offset \u003d mult[unit] * 52 * 5  # 5 years"},{"line_number":197,"context_line":"    tenant_defaults \u003d {"},{"line_number":198,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp_2w,"},{"line_number":199,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_80f3830a","line":196,"range":{"start_line":196,"start_character":43,"end_line":196,"end_character":49},"in_reply_to":"5faad753_363c61c7","updated":"2019-09-10 14:29:02.000000000","message":"There must be an end time otherwise the chunked query carries on forever. I have added nodes to this regard.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def main():"},{"line_number":196,"context_line":"    default_end_time_offset \u003d mult[unit] * 52 * 5  # 5 years"},{"line_number":197,"context_line":"    tenant_defaults \u003d {"},{"line_number":198,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp_2w,"},{"line_number":199,"context_line":"    }"},{"line_number":200,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_767099a6","line":197,"range":{"start_line":197,"start_character":3,"end_line":197,"end_character":19},"updated":"2019-09-10 11:18:28.000000000","message":"We can\u0027t set this from the command line, but at the very least we should provide a comment here with a TODO saying that it could be future work and that for now someone can modify this. The idea is to map default retention policies to tenants?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def main():"},{"line_number":196,"context_line":"    default_end_time_offset \u003d mult[unit] * 52 * 5  # 5 years"},{"line_number":197,"context_line":"    tenant_defaults \u003d {"},{"line_number":198,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp_2w,"},{"line_number":199,"context_line":"    }"},{"line_number":200,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_60c1a780","line":197,"range":{"start_line":197,"start_character":3,"end_line":197,"end_character":19},"in_reply_to":"5faad753_767099a6","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    tenant_defaults \u003d {"},{"line_number":198,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp_2w,"},{"line_number":199,"context_line":"    }"},{"line_number":200,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    helper \u003d MigrationHelper()"},{"line_number":203,"context_line":"    helper.migrate(skip_functions\u003dskip_functions,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_b684d15f","line":200,"range":{"start_line":200,"start_character":4,"end_line":200,"end_character":18},"updated":"2019-09-10 11:18:28.000000000","message":"Same comment as above. Nice idea, we just need to explain to people clearly that it can be used to skip certain metrics, and note that there is future work to support it from the command line, rather than directly editing this script.\n\nArguably, the cleanup should be done as a pre-processing step and should be separate to migration, but not to worry.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    tenant_defaults \u003d {"},{"line_number":198,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp_2w,"},{"line_number":199,"context_line":"    }"},{"line_number":200,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    helper \u003d MigrationHelper()"},{"line_number":203,"context_line":"    helper.migrate(skip_functions\u003dskip_functions,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_20bbaf0e","line":200,"range":{"start_line":200,"start_character":4,"end_line":200,"end_character":18},"in_reply_to":"5faad753_b684d15f","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    helper.migrate(skip_functions\u003dskip_functions,"},{"line_number":204,"context_line":"                   time_unit\u003dunit,"},{"line_number":205,"context_line":"                   tenant_defaults\u003dtenant_defaults,"},{"line_number":206,"context_line":"                   default_end_time_offset\u003ddefault_end_time_offset,"},{"line_number":207,"context_line":"                   default_start_time_offset\u003d0,"},{"line_number":208,"context_line":"                   measurements_file\u003d\u0027migrate-measurements.log\u0027,"},{"line_number":209,"context_line":"                   success_file\u003d\u0027migrate-success.log\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_f691e99a","line":206,"range":{"start_line":206,"start_character":19,"end_line":206,"end_character":42},"updated":"2019-09-10 11:18:28.000000000","message":"Can we not just define all time rather than a start and end? Are you doing it in chunks because it is too slow otherwise? It would be nice to document the thinking as a comment.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    helper.migrate(skip_functions\u003dskip_functions,"},{"line_number":204,"context_line":"                   time_unit\u003dunit,"},{"line_number":205,"context_line":"                   tenant_defaults\u003dtenant_defaults,"},{"line_number":206,"context_line":"                   default_end_time_offset\u003ddefault_end_time_offset,"},{"line_number":207,"context_line":"                   default_start_time_offset\u003d0,"},{"line_number":208,"context_line":"                   measurements_file\u003d\u0027migrate-measurements.log\u0027,"},{"line_number":209,"context_line":"                   success_file\u003d\u0027migrate-success.log\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_c0609ba8","line":206,"range":{"start_line":206,"start_character":19,"end_line":206,"end_character":42},"in_reply_to":"5faad753_f691e99a","updated":"2019-09-10 14:29:02.000000000","message":"Unfortunately I couldn\u0027t work out a reliable way of doing all time... I can get the query to stop if there was nothing in the last chunk but that chunk might not contain data... it seems safer to let the user specify.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"760ef1b6c720c82b21e731db59ef02f61affd2b1","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                   tenant_defaults\u003dtenant_defaults,"},{"line_number":206,"context_line":"                   default_end_time_offset\u003ddefault_end_time_offset,"},{"line_number":207,"context_line":"                   default_start_time_offset\u003d0,"},{"line_number":208,"context_line":"                   measurements_file\u003d\u0027migrate-measurements.log\u0027,"},{"line_number":209,"context_line":"                   success_file\u003d\u0027migrate-success.log\u0027,"},{"line_number":210,"context_line":"                   failure_file\u003d\u0027migrate-failure.log\u0027)"},{"line_number":211,"context_line":"    return 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_a2becc62","line":208,"updated":"2019-09-10 11:18:28.000000000","message":"I see these files, which are nice, but I don\u0027t see any of the other log INFO output. When I run `python monasca_persister/tools/influxdb/db-per-tenant/migrate-to-db-per-tenant.py --config-file /etc/kolla/monasca-persister/persister.conf` I don\u0027t see any output, and I can\u0027t see it in the log files.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"0bc9b9b3152d189380018974027f20dade9975d5","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                   tenant_defaults\u003dtenant_defaults,"},{"line_number":206,"context_line":"                   default_end_time_offset\u003ddefault_end_time_offset,"},{"line_number":207,"context_line":"                   default_start_time_offset\u003d0,"},{"line_number":208,"context_line":"                   measurements_file\u003d\u0027migrate-measurements.log\u0027,"},{"line_number":209,"context_line":"                   success_file\u003d\u0027migrate-success.log\u0027,"},{"line_number":210,"context_line":"                   failure_file\u003d\u0027migrate-failure.log\u0027)"},{"line_number":211,"context_line":"    return 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_9911c6af","line":208,"in_reply_to":"5faad753_56c79d46","updated":"2019-09-10 12:31:02.000000000","message":"Hmm, I don\u0027t see them. Given that this will generally run in the foreground can we make it default to stdout?","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"086aba85ab6396fdc3a2eca925e529f0c3955c90","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                   tenant_defaults\u003dtenant_defaults,"},{"line_number":206,"context_line":"                   default_end_time_offset\u003ddefault_end_time_offset,"},{"line_number":207,"context_line":"                   default_start_time_offset\u003d0,"},{"line_number":208,"context_line":"                   measurements_file\u003d\u0027migrate-measurements.log\u0027,"},{"line_number":209,"context_line":"                   success_file\u003d\u0027migrate-success.log\u0027,"},{"line_number":210,"context_line":"                   failure_file\u003d\u0027migrate-failure.log\u0027)"},{"line_number":211,"context_line":"    return 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_e02ef7f8","line":208,"in_reply_to":"5faad753_9911c6af","updated":"2019-09-10 14:29:02.000000000","message":"Done","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":28022,"name":"Bharat Kunwar","email":"brtknr@bath.edu","username":"brtknr"},"change_message_id":"b20c91f77fd6a781d03a74ab1acc89580e688a4a","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                   tenant_defaults\u003dtenant_defaults,"},{"line_number":206,"context_line":"                   default_end_time_offset\u003ddefault_end_time_offset,"},{"line_number":207,"context_line":"                   default_start_time_offset\u003d0,"},{"line_number":208,"context_line":"                   measurements_file\u003d\u0027migrate-measurements.log\u0027,"},{"line_number":209,"context_line":"                   success_file\u003d\u0027migrate-success.log\u0027,"},{"line_number":210,"context_line":"                   failure_file\u003d\u0027migrate-failure.log\u0027)"},{"line_number":211,"context_line":"    return 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5faad753_56c79d46","line":208,"in_reply_to":"5faad753_a2becc62","updated":"2019-09-10 11:33:08.000000000","message":"The logs ought to appear in journalctl.","commit_id":"011264c6f98f2b0c6a74c2388a00d8dc984eabab"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\""},{"line_number":17,"context_line":"Monasca InfluxDB tool for migration to database per tenant"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Used to move data from monolithic database e.g. `monasca` to a database per"},{"line_number":20,"context_line":"tenant model, e.g. `monasca_\u003ctenant_id\u003e`."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Please see the included README.rst for more details about creating an"},{"line_number":23,"context_line":"appropriate configuration file."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"migrate-to-db-per-tenant.py --config-file \u003cini\u003e"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    --config-file \u003cini\u003e (Optional) Configuration file as described in README.rst"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Example:"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"migrate-to-db-per-tenant.py --config-file \u003cpath\u003e/persister.ini"},{"line_number":32,"context_line":"\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"import sys"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_9769788c","line":31,"range":{"start_line":17,"start_character":0,"end_line":31,"end_character":62},"updated":"2019-09-11 08:57:01.000000000","message":"Can we not fix the help message? It\u0027s still broken right?","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"MULT \u003d dict(w\u003d1, d\u003d7)  # Multiplier"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"MIGRATE_QUERY \u003d (\u0027SELECT * INTO \"{target_db}\"..:MEASUREMENT\u0027"},{"line_number":47,"context_line":"                          \u0027 FROM \"{measurement}\"\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_f4146a50","line":44,"range":{"start_line":44,"start_character":22,"end_line":44,"end_character":35},"updated":"2019-09-11 08:57:01.000000000","message":"Multiplier for ...","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def migrate(self,"},{"line_number":136,"context_line":"                tenant_defaults\u003d{},"},{"line_number":137,"context_line":"                default_start_time_offset\u003d0, # Default: now"},{"line_number":138,"context_line":"                default_end_time_offset\u003d(520),  # Default: 10 years"},{"line_number":139,"context_line":"                skip_functions\u003d[],"},{"line_number":140,"context_line":"                measurements_file\u003dNone, success_file\u003dNone, failure_file\u003dNone, **kwargs):"},{"line_number":141,"context_line":"        measurements \u003d self.get_measurements(measurements_file)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_77f15ccd","line":138,"range":{"start_line":137,"start_character":0,"end_line":138,"end_character":67},"updated":"2019-09-11 08:57:01.000000000","message":"Migrate metrics from now until 10 years in the future? Now should be time since epoch?","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    def migrate(self,"},{"line_number":136,"context_line":"                tenant_defaults\u003d{},"},{"line_number":137,"context_line":"                default_start_time_offset\u003d0, # Default: now"},{"line_number":138,"context_line":"                default_end_time_offset\u003d(520),  # Default: 10 years"},{"line_number":139,"context_line":"                skip_functions\u003d[],"},{"line_number":140,"context_line":"                measurements_file\u003dNone, success_file\u003dNone, failure_file\u003dNone, **kwargs):"},{"line_number":141,"context_line":"        measurements \u003d self.get_measurements(measurements_file)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_97fe58ac","line":138,"range":{"start_line":138,"start_character":40,"end_line":138,"end_character":45},"updated":"2019-09-11 08:57:01.000000000","message":"below you are multiplying by MULT when you pass this in","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":191,"context_line":"def main():"},{"line_number":192,"context_line":"    time_unit \u003d \u0027d\u0027  # Unit of time to migrate at a time, d\u003dday, w\u003dweek"},{"line_number":193,"context_line":"    # Default end time must be specified because the migration takes place in"},{"line_number":194,"context_line":"    # changes and it needs to know when to stop."},{"line_number":195,"context_line":"    default_end_time_offset \u003d MULT[time_unit] * 520  # 10 years"},{"line_number":196,"context_line":"    "},{"line_number":197,"context_line":"    # Configure default retention policy to your existing projects. For"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_170d8836","line":194,"range":{"start_line":194,"start_character":6,"end_line":194,"end_character":13},"updated":"2019-09-11 08:57:01.000000000","message":"do you mean batches?","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":192,"context_line":"    time_unit \u003d \u0027d\u0027  # Unit of time to migrate at a time, d\u003dday, w\u003dweek"},{"line_number":193,"context_line":"    # Default end time must be specified because the migration takes place in"},{"line_number":194,"context_line":"    # changes and it needs to know when to stop."},{"line_number":195,"context_line":"    default_end_time_offset \u003d MULT[time_unit] * 520  # 10 years"},{"line_number":196,"context_line":"    "},{"line_number":197,"context_line":"    # Configure default retention policy to your existing projects. For"},{"line_number":198,"context_line":"    # example, rp2w is a retention policy of two weeks which we can assign to"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_774b9c58","line":195,"range":{"start_line":195,"start_character":30,"end_line":195,"end_character":63},"updated":"2019-09-11 08:57:01.000000000","message":"Isn\u0027t this the default except the default isn\u0027t multiplied by `MULT`? You have the same comment for 10 years in both cases.","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":193,"context_line":"    # Default end time must be specified because the migration takes place in"},{"line_number":194,"context_line":"    # changes and it needs to know when to stop."},{"line_number":195,"context_line":"    default_end_time_offset \u003d MULT[time_unit] * 520  # 10 years"},{"line_number":196,"context_line":"    "},{"line_number":197,"context_line":"    # Configure default retention policy to your existing projects. For"},{"line_number":198,"context_line":"    # example, rp2w is a retention policy of two weeks which we can assign to"},{"line_number":199,"context_line":"    # project 03cc1b94463c44e791222cb82008b8b1."}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_377764a3","line":196,"range":{"start_line":196,"start_character":0,"end_line":196,"end_character":4},"updated":"2019-09-11 08:57:01.000000000","message":"nit","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    # Configure default retention policy to your existing projects. For"},{"line_number":198,"context_line":"    # example, rp2w is a retention policy of two weeks which we can assign to"},{"line_number":199,"context_line":"    # project 03cc1b94463c44e791222cb82008b8b1."},{"line_number":200,"context_line":"    rp2w \u003d dict(end\u003d(MULT[time_unit] * 2),"},{"line_number":201,"context_line":"                rp\u003ddict(name\u003d\u00272w\u0027, duration\u003d\u00272w\u0027, replication\u003d\u00271\u0027, default\u003dTrue))"},{"line_number":202,"context_line":"    tenant_defaults \u003d {"},{"line_number":203,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp2w,"},{"line_number":204,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_d7d85080","line":201,"range":{"start_line":200,"start_character":4,"end_line":201,"end_character":81},"updated":"2019-09-11 08:57:01.000000000","message":"This should probably be commented out because it isn\u0027t used","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp2w,"},{"line_number":204,"context_line":"    }"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    # If you want to skip migtaion of metrics, enumerate them as per example."},{"line_number":207,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    helper \u003d MigrationHelper()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_97bbb80c","line":206,"range":{"start_line":206,"start_character":35,"end_line":206,"end_character":45},"updated":"2019-09-11 08:57:01.000000000","message":"of specific?","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"fc10bf6ba5ea4a2f8d88e12082ee4cd7a0f7c9bc","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        # e.g. \"03cc1b94463c44e791222cb82008b8b1\": rp2w,"},{"line_number":204,"context_line":"    }"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    # If you want to skip migtaion of metrics, enumerate them as per example."},{"line_number":207,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    helper \u003d MigrationHelper()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5faad753_f7cc6cbd","line":206,"range":{"start_line":206,"start_character":26,"end_line":206,"end_character":34},"updated":"2019-09-11 08:57:01.000000000","message":"typo","commit_id":"b6abf1b729656f3f030d6b38bc02bc3e3692724d"},{"author":{"_account_id":14123,"name":"Stefano Canepa","email":"sc@linux.it","username":"sc"},"change_message_id":"7bf542eb0ca15626e2035226c3844bc5ad375802","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        \"example-project-id\": rp2w,"},{"line_number":204,"context_line":"    }"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    # If you want to skip migtaion of metrics, enumerate them as per example."},{"line_number":207,"context_line":"    skip_functions \u003d []  # e.g. [lambda x: x.startswith(\u0027log.\u0027)]"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    helper \u003d MigrationHelper()"}],"source_content_type":"text/x-python","patch_set":14,"id":"3fa7e38b_009a3e6d","line":206,"range":{"start_line":206,"start_character":26,"end_line":206,"end_character":34},"updated":"2019-09-19 15:34:46.000000000","message":"typo","commit_id":"9f3dcbcdd2dd5888b21a88747d20e8a25264fbf3"}]}
