)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"eaa004a929995f3dd16746fbe8b91cfb124e12ce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0714c470_d115613c","updated":"2022-03-17 18:22:42.000000000","message":"Using disk metrics to put back pressure on various consumers of io as a \"concept\" has been kicked around for awhile without a lot of code being written.  Perhaps there\u0027s some value in producing \"something\" around which we can frame a conversation.  Or perhaps we require more discussion - at least using the kernal\u0027s device stats gets us some IPC, maybe it\u0027s cheap enough to open and read them every request?","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"89a29b3f1a17b73d1a0362178ed8fb276603e3ae","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1362682a_a7db8f52","in_reply_to":"0714c470_d115613c","updated":"2022-03-23 21:23:41.000000000","message":"Well it\u0027s reading a vitual file from the kernel, I assume in memory.. so should be pretty inexpensive I suspect. But yeah running on everyrequest does sound a little much.","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"}],"etc/container-server.conf-sample":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"89a29b3f1a17b73d1a0362178ed8fb276603e3ae","unresolved":true,"context_lines":[{"line_number":134,"context_line":"# req_per_second \u003d 0.0"},{"line_number":135,"context_line":"#"},{"line_number":136,"context_line":"# ratelimit_disk_stat \u003d \u0027weighted_time_spent_doing_io_average\u0027"},{"line_number":137,"context_line":"# ratelimit_disk_stat_threshold \u003d 5"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"[filter:healthcheck]"},{"line_number":140,"context_line":"use \u003d egg:swift#healthcheck"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"dbb3c4c7_27045b24","line":137,"updated":"2022-03-23 21:23:41.000000000","message":"no idea if this is the right stat, the number is well a number, not even an educated guess :P","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"}],"swift/common/base_storage_server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"eaa004a929995f3dd16746fbe8b91cfb124e12ce","unresolved":true,"context_lines":[{"line_number":42,"context_line":"            if dev_path in line:"},{"line_number":43,"context_line":"                pysical_device \u003d line.split()[0]"},{"line_number":44,"context_line":"                device_name \u003d basename(pysical_device)"},{"line_number":45,"context_line":"                break"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    if not pysical_device:"},{"line_number":48,"context_line":"        raise ValueError(\"Couldn\u0027t find device\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"df1202e3_2114c01b","line":45,"updated":"2022-03-17 18:22:42.000000000","message":"would it be reasonable (neccessary?) to perform some per-process caching of this information?","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"89a29b3f1a17b73d1a0362178ed8fb276603e3ae","unresolved":true,"context_lines":[{"line_number":42,"context_line":"            if dev_path in line:"},{"line_number":43,"context_line":"                pysical_device \u003d line.split()[0]"},{"line_number":44,"context_line":"                device_name \u003d basename(pysical_device)"},{"line_number":45,"context_line":"                break"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    if not pysical_device:"},{"line_number":48,"context_line":"        raise ValueError(\"Couldn\u0027t find device\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"d74cb1b9_f48564ad","line":45,"in_reply_to":"df1202e3_2114c01b","updated":"2022-03-23 21:23:41.000000000","message":"Probably, I just threw this together to see how it looked and to give a basic demonstration. Having a service or thread to just ask for stats could be useful and cache the result.","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"eaa004a929995f3dd16746fbe8b91cfb124e12ce","unresolved":true,"context_lines":[{"line_number":60,"context_line":"                # mapper"},{"line_number":61,"context_line":"                try:"},{"line_number":62,"context_line":"                    pysical_device \u003d run_command("},{"line_number":63,"context_line":"                        [\u0027readlink\u0027, pysical_device]).strip()"},{"line_number":64,"context_line":"                    device_name \u003d basename(pysical_device)"},{"line_number":65,"context_line":"                except ValueError:"},{"line_number":66,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":1,"id":"db08522f_ff543b3a","line":63,"updated":"2022-03-17 18:22:42.000000000","message":"I think we can do better\n\nhttps://docs.python.org/3/library/os.html#os.readlink","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"eaa004a929995f3dd16746fbe8b91cfb124e12ce","unresolved":true,"context_lines":[{"line_number":90,"context_line":"        \u0027weighted_time_spent_doing_io\u0027, \u0027time_spent_discarding\u0027,"},{"line_number":91,"context_line":"        \u0027time_spent_flushing\u0027]"},{"line_number":92,"context_line":"    stats \u003d {k: v"},{"line_number":93,"context_line":"             for k, v in izip_longest(stat_names, results, fillvalue\u003d\"-1\")}"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    if include_avg:"},{"line_number":96,"context_line":"        for stat in stat_time_counters:"}],"source_content_type":"text/x-python","patch_set":1,"id":"252e7740_2826cc1d","line":93,"updated":"2022-03-17 18:22:42.000000000","message":"it\u0027s not obvious to me that maintaining this ineline is better than investing more in py3 so we can have https://docs.python.org/3/library/shutil.html#shutil.disk_usage","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"89a29b3f1a17b73d1a0362178ed8fb276603e3ae","unresolved":true,"context_lines":[{"line_number":90,"context_line":"        \u0027weighted_time_spent_doing_io\u0027, \u0027time_spent_discarding\u0027,"},{"line_number":91,"context_line":"        \u0027time_spent_flushing\u0027]"},{"line_number":92,"context_line":"    stats \u003d {k: v"},{"line_number":93,"context_line":"             for k, v in izip_longest(stat_names, results, fillvalue\u003d\"-1\")}"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    if include_avg:"},{"line_number":96,"context_line":"        for stat in stat_time_counters:"}],"source_content_type":"text/x-python","patch_set":1,"id":"e3fbae0e_62d5a80a","line":93,"in_reply_to":"252e7740_2826cc1d","updated":"2022-03-23 21:23:41.000000000","message":"Sure, but that returns disk usage (total, used and free) not disk IO statistics like from /proc","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"eaa004a929995f3dd16746fbe8b91cfb124e12ce","unresolved":true,"context_lines":[{"line_number":117,"context_line":"        self.req_per_second \u003d float(conf.get(\u0027req_per_second\u0027, 0.0))"},{"line_number":118,"context_line":"        self.tokens \u003d max(1, self.req_per_second)"},{"line_number":119,"context_line":"        self.last_token_update \u003d time.time()"},{"line_number":120,"context_line":"        self.ratelimit_disk_stat \u003d conf.get(\"ratelmit_disk_stat\")"},{"line_number":121,"context_line":"        self.ratelimit_dist_stat_threshold \u003d float("},{"line_number":122,"context_line":"            conf.get(\"ratelmit_disk_stat_threshold\"))"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"42b11b4b_6b2538f3","line":120,"updated":"2022-03-17 18:22:42.000000000","message":"I think we should at least attempt to recommend a default","commit_id":"f9184c1f76e90aec602e84236252fec7a8d8d65e"}]}
