def _initDiskStats(self):
self._diskStats = {}<EOL>self._mapMajorMinor2dev = {}<EOL>try:<EOL><INDENT>fp = open(diskStatsFile, '<STR_LIT:r>')<EOL>data = fp.read()<EOL>fp.close()<EOL><DEDENT>except:<EOL><INDENT>raise IOError('<STR_LIT>'<EOL>% diskStatsFile)<EOL><DEDENT>for line in data.splitlines():<EOL><INDENT>cols = line.split()<EOL>dev = cols.pop(<NUM_LIT:2>)<EOL>if len(cols) == <NUM_LIT>:<EOL><INDENT>self._diskStats[dev] = dict(list(zip(<EOL>('<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>'),<EOL>[int(x) for x in cols])))<EOL><DEDENT>elif len(cols) == <NUM_LIT:6>:<EOL><INDENT>self._diskStats[dev] = dict(list(zip(<EOL>('<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>'),<EOL>[int(x) for x in cols])))<EOL><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT>self._diskStats[dev]['<STR_LIT>'] = (<EOL>self._diskStats[dev]['<STR_LIT>'] * sectorSize)<EOL>self._diskStats[dev]['<STR_LIT>'] = (<EOL>self._diskStats[dev]['<STR_LIT>'] * sectorSize)<EOL>self._mapMajorMinor2dev[(int(cols[<NUM_LIT:0>]), int(cols[<NUM_LIT:1>]))] = dev<EOL><DEDENT>
Parse and initialize block device I/O stats in /proc/diskstats.