Esempio n. 1
0
    def process_summary(self, arg_sum_level=SummaryLevel.Fail):

        # Msg.user( "process_summary()", "REG-SUMMARY" )
        my_utcdt = DateTime.UTCNow()
        my_file_name = "%sregression_summary.log" % (
            PathUtils().include_trailing_path_delimiter(self.summary_dir)
        )
        # Msg.user( "Master Log File: %s" % ( my_file_name ))
        my_ofile = None
        myLines = []
        # First try to open file
        with open(my_file_name, "w") as my_ofile:
            try:
                my_ofile.write("Date: %s\n" % (DateTime.DateAsStr(my_utcdt)))
                my_ofile.write("Time: %s\n" % (DateTime.TimeAsStr(my_utcdt)))
                self.process_errors(my_ofile)
                my_instr_count, my_cycle_count = self.process_summary_tasks(
                    my_ofile, arg_sum_level
                )
                self.process_summary_totals(my_ofile, my_instr_count, my_cycle_count)

            except Exception as arg_ex:
                Msg.error_trace()
                Msg.err("Processing Summary, " + str(arg_ex))

            finally:
                my_ofile.close()
    def process_summary(self, sum_level=SummaryLevel.Fail):

        my_file_name = "%sperformance_summary.log" % (
            PathUtils().include_trailing_path_delimiter(self.summary_dir))
        Msg.dbg("Master Log File: %s" % (my_file_name))
        my_utcdt = DateTime.UTCNow()
        my_ofile = None
        try:
            # First try to open file
            with open(my_file_name, "w") as my_ofile:

                my_ofile.write("Date: %s\n" % (DateTime.DateAsStr(my_utcdt)))
                my_ofile.write("Time: %s\n" % (DateTime.TimeAsStr(my_utcdt)))

                self.process_errors(my_ofile)
                my_total_count, my_total_elapsed = self.process_groups(
                    my_ofile)

                Msg.blank("info")
                my_line = "Total Instructions Generated: %3d\n" % (
                    my_total_count)
                my_line += "Total Elapsed Time:  %0.3f\n" % (my_total_elapsed)
                my_line += "Overall Instructions per Second:  %0.3f\n" % (
                    SysUtils.ifthen(bool(my_total_elapsed),
                                    my_total_count / my_total_elapsed, 0))

                Msg.info(my_line)
                my_ofile.write(my_line)

        except Exception as arg_ex:
            Msg.error_trace()
            Msg.err("Error Processing Summary, " + str(arg_ex))

        finally:
            my_ofile.close()