def parse(self):
file_status = True<EOL>for input_file in self.infile_list:<EOL><INDENT>file_status = file_status and naarad.utils.is_valid_file(input_file)<EOL>if not file_status:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>status = True<EOL>cur_zone = None<EOL>cur_submetric = None<EOL>cur_value = None<EOL>data = {}  <EOL>for input_file in self.infile_list:<EOL><INDENT>logger.info('<STR_LIT>', input_file)<EOL>timestamp_format = None<EOL>with open(input_file) as fh:<EOL><INDENT>for line in fh:<EOL><INDENT>words = line.replace('<STR_LIT:U+002C>', '<STR_LIT:U+0020>').split()           <EOL>if len(words) < <NUM_LIT:3>:<EOL><INDENT>continue<EOL><DEDENT>ts = words[<NUM_LIT:0>] + "<STR_LIT:U+0020>" + words[<NUM_LIT:1>]<EOL>if not timestamp_format or timestamp_format == '<STR_LIT>':<EOL><INDENT>timestamp_format = naarad.utils.detect_timestamp_format(ts)<EOL><DEDENT>if timestamp_format == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>ts = naarad.utils.get_standardized_timestamp(ts, timestamp_format)<EOL>if self.ts_out_of_range(ts):<EOL><INDENT>continue<EOL><DEDENT>if words[<NUM_LIT:2>] == '<STR_LIT>':  <EOL><INDENT>cols = words[<NUM_LIT:2>:]<EOL>cur_zone = '<STR_LIT:.>'.join(cols)<EOL>continue<EOL><DEDENT>elif words[<NUM_LIT:2>] == '<STR_LIT>':  <EOL><INDENT>cur_submetric = words[<NUM_LIT:2>] + '<STR_LIT:.>' + words[<NUM_LIT:3>]  <EOL>cur_value = words[<NUM_LIT:4>]<EOL><DEDENT>elif words[<NUM_LIT:2>] in self.processed_sub_metrics:<EOL><INDENT>cur_submetric = '<STR_LIT>' + '<STR_LIT:.>' + words[<NUM_LIT:2>]  <EOL>cur_value = words[<NUM_LIT:3>]<EOL><DEDENT>elif words[<NUM_LIT:2>] in self.skipped_sub_metrics:<EOL><INDENT>continue<EOL><DEDENT>else:   <EOL><INDENT>cur_submetric = words[<NUM_LIT:2>]<EOL>cur_value = words[<NUM_LIT:3>]<EOL><DEDENT>col = cur_zone + '<STR_LIT:.>' + cur_submetric  <EOL>if cur_zone and self.zones and cur_zone not in self.zones:<EOL><INDENT>continue<EOL><DEDENT>self.sub_metric_unit[col] = '<STR_LIT>'  <EOL>if self.sub_metrics and cur_submetric and cur_submetric not in self.sub_metrics:<EOL><INDENT>continue<EOL><DEDENT>if col in self.column_csv_map:<EOL><INDENT>out_csv = self.column_csv_map[col]<EOL><DEDENT>else:<EOL><INDENT>out_csv = self.get_csv(col)   <EOL>data[out_csv] = []<EOL><DEDENT>data[out_csv].append(ts + "<STR_LIT:U+002C>" + cur_value)<EOL><DEDENT><DEDENT><DEDENT>for csv in data.keys():<EOL><INDENT>self.csv_files.append(csv)<EOL>with open(csv, '<STR_LIT:w>') as fh:<EOL><INDENT>fh.write('<STR_LIT:\n>'.join(sorted(data[csv])))<EOL><DEDENT><DEDENT>return status<EOL>
Parse the vmstat file
:return: status of the metric parse