)]}'
{"monasca_agent/collector/checks_d/disk.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"5b7757a03522db4453fb54055e35eb37267a3e4f","unresolved":false,"context_lines":[{"line_number":153,"context_line":"    def _get_device_name(self, device):"},{"line_number":154,"context_line":"        if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":155,"context_line":"            # on Windows, the device has the following format: C:\\"},{"line_number":156,"context_line":"            return device[0]"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        start \u003d device.rfind(\"/\")"},{"line_number":159,"context_line":"        if start \u003e -1:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_efc9ab5a","line":156,"range":{"start_line":156,"start_character":12,"end_line":156,"end_character":18},"updated":"2016-06-07 19:17:50.000000000","message":"Maybe over-engineering this, but i was just wondering if you wanted to use Disk as a base class, with _get_inode_used_perc and _get_device_name as template methods, and then derive a win32 and linux specific implementation/class?","commit_id":"921b47e784eabbc70c6f8e1adfc4ce04dff0550c"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"767c5e5e458dee7327345fc7027e3d948ebb19bc","unresolved":false,"context_lines":[{"line_number":153,"context_line":"    def _get_device_name(self, device):"},{"line_number":154,"context_line":"        if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":155,"context_line":"            # on Windows, the device has the following format: C:\\"},{"line_number":156,"context_line":"            return device[0]"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        start \u003d device.rfind(\"/\")"},{"line_number":159,"context_line":"        if start \u003e -1:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_fea5d3a1","line":156,"range":{"start_line":156,"start_character":12,"end_line":156,"end_character":18},"in_reply_to":"7aa08908_efc9ab5a","updated":"2016-08-10 15:59:17.000000000","message":"yeah, that would be my preffered implementation as well, but I\u0027ve got negative reviews on other checkers that have such a behaviour.","commit_id":"921b47e784eabbc70c6f8e1adfc4ce04dff0550c"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"3aaf4cb70a6c0f323e6ae3ca49304915d77d7f46","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        # On Windows, the Floppy Disk Drive and the CD / DVD Drive has the"},{"line_number":49,"context_line":"        # fs_type \u003d \u0027\u0027. Those devices cannot have their disk usage inspected."},{"line_number":50,"context_line":"        # We need to ignore those devices, in order to skip errors."},{"line_number":51,"context_line":"        fs_types_to_ignore.append(\u0027\u0027)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        partitions \u003d psutil.disk_partitions(all\u003dTrue)"},{"line_number":54,"context_line":"        if send_io_stats:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_16b97079","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":37},"updated":"2016-09-30 20:24:39.000000000","message":"Let\u0027s only do this on Windows","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"3aaf4cb70a6c0f323e6ae3ca49304915d77d7f46","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        disk_count \u003d 0"},{"line_number":57,"context_line":"        total_capacity \u003d 0"},{"line_number":58,"context_line":"        total_used \u003d 0"},{"line_number":59,"context_line":"        inode_used_perc \u003d 0"},{"line_number":60,"context_line":"        for partition in partitions:"},{"line_number":61,"context_line":"            if partition.fstype not in fs_types_to_ignore \\"},{"line_number":62,"context_line":"                and (not device_blacklist_re"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_76e394a4","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":27},"updated":"2016-09-30 20:24:39.000000000","message":"No need to initialize this here","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"3aaf4cb70a6c0f323e6ae3ca49304915d77d7f46","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                               device_name\u003ddevice_name,"},{"line_number":86,"context_line":"                               dimensions\u003ddimensions)"},{"line_number":87,"context_line":"                    disk_count +\u003d 1"},{"line_number":88,"context_line":"                    if inode_used_perc:"},{"line_number":89,"context_line":"                        self.gauge(\"disk.inode_used_perc\","},{"line_number":90,"context_line":"                                   inode_used_perc,"},{"line_number":91,"context_line":"                                   device_name\u003ddevice_name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_96b90018","line":88,"range":{"start_line":88,"start_character":23,"end_line":88,"end_character":38},"updated":"2016-09-30 20:24:39.000000000","message":"On a large underutilized disk, you could end up with this being a value of 0.00. I actually have that on my test OpenStack system because I didn\u0027t deploy everything. So, you should instead return None when you don\u0027t have a value and replace this with if inode_used_perc is not None:","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"},{"author":{"_account_id":22157,"name":"Andrea Adams","email":"aadams@hpe.com","username":"andrea.adams"},"change_message_id":"58672a87da60e38a262e21c5f36bc84ff18d29ca","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    disk_count \u003d 0"},{"line_number":97,"context_line":"                    if send_io_stats:"},{"line_number":98,"context_line":"                        try:"},{"line_number":99,"context_line":"                            stats \u003d disk_stats[device_name]"},{"line_number":100,"context_line":"                            self.rate(\"io.read_req_sec\", round(float(stats.read_count), 2), device_name\u003ddevice_name, dimensions\u003ddimensions)"},{"line_number":101,"context_line":"                            self.rate(\"io.write_req_sec\", round(float(stats.write_count), 2), device_name\u003ddevice_name, dimensions\u003ddimensions)"},{"line_number":102,"context_line":"                            self.rate(\"io.read_kbytes_sec\", round(float(stats.read_bytes / 1024), 2), device_name\u003ddevice_name, dimensions\u003ddimensions)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_eeb5a77e","line":99,"range":{"start_line":99,"start_character":36,"end_line":99,"end_character":46},"updated":"2016-10-10 21:15:17.000000000","message":"On my windows box, disk_stats has PhysicalDrive1 and PhysicalDrive0, so these 6 metrics are impossible to extract with the device_name \"C\". disk_stats: {\u0027PhysicalDrive1\u0027: sdiskio(read_count\u003d4157850, write_count\u003d4788327, read_bytes\u003d108173642240L, write_bytes\u003d109856739840L, read_time\u003d369830415540L, write_time\u003d77863829880L), \u0027PhysicalDrive0\u0027: sdiskio(read_count\u003d256, write_count\u003d541, read_bytes\u003d1484800L, write_bytes\u003d3065344L, read_time\u003d13500L, write_time\u003d147140L)}","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"3aaf4cb70a6c0f323e6ae3ca49304915d77d7f46","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            log.debug(\u0027Collected 2 rolled-up disk usage metrics\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _get_inode_used_perc(self, partition):"},{"line_number":121,"context_line":"        if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":122,"context_line":"            # cannot get value for this."},{"line_number":123,"context_line":"            return 0"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_d6c0e852","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":34},"updated":"2016-09-30 20:24:39.000000000","message":"I think this would be cleaner if you had an instance variable like _is_windows that gets set in __init__ instead of doing this check everywhere","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"3aaf4cb70a6c0f323e6ae3ca49304915d77d7f46","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        return file_system_list"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def _get_device_name(self, device):"},{"line_number":154,"context_line":"        if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":155,"context_line":"            # on Windows, the device has the following format: C:\\"},{"line_number":156,"context_line":"            return device[0]"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_76a8f420","line":154,"range":{"start_line":154,"start_character":8,"end_line":154,"end_character":34},"updated":"2016-09-30 20:24:39.000000000","message":"See above","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"3aaf4cb70a6c0f323e6ae3ca49304915d77d7f46","unresolved":false,"context_lines":[{"line_number":153,"context_line":"    def _get_device_name(self, device):"},{"line_number":154,"context_line":"        if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":155,"context_line":"            # on Windows, the device has the following format: C:\\"},{"line_number":156,"context_line":"            return device[0]"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        start \u003d device.rfind(\"/\")"},{"line_number":159,"context_line":"        if start \u003e -1:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_56a2189a","line":156,"range":{"start_line":156,"start_character":19,"end_line":156,"end_character":28},"updated":"2016-09-30 20:24:39.000000000","message":"If this is really something like C:\\, won\u0027t that backslash cause the aggregator to reject the dimension with device_name?","commit_id":"049015edfa5e01ee62d5ad5154e806bd8fd51f92"}]}
