Skip to content

Commit

Permalink
Adding code to write stats to output file if -out_stat job option is …
Browse files Browse the repository at this point in the history
…supplied. In serialize(), fixed bug for -out_stat option string to use StatFile. In TCStatJobRIRW::do_job(), added code to call do_output(*StatOut). SL ci-skip-all
  • Loading branch information
Seth Linden committed Apr 5, 2023
1 parent ba81fc6 commit c0ae655
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/tools/tc_utils/tc_stat/tc_stat_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ ConcatString TCStatJob::serialize() const {
if(DumpFile.length() > 0)
s << "-dump_row " << DumpFile << " ";
if(StatFile.length() > 0)
s << "-stat_row " << StatFile << " ";
s << "-out_stat " << StatFile << " ";

return(s);
}
Expand Down Expand Up @@ -2158,7 +2158,7 @@ void TCStatJobSummary::do_job(const StringArray &file_list,
// Process the filter output
if(JobOut) do_output(*JobOut);
else do_output(cout);

return;
}

Expand Down Expand Up @@ -3166,6 +3166,8 @@ void TCStatJobRIRW::do_job(const StringArray &file_list,
if(JobOut) do_output(*JobOut);
else do_output(cout);

if(StatOut) do_output(*StatOut);

return;
}

Expand Down Expand Up @@ -3394,6 +3396,10 @@ void TCStatJobRIRW::do_ctc_output(ostream &out) {
// Initialize row and column indices
r = c = 0;

// testing
if(StatOut)
cout << "YES, -out_stat option invoked" << endl;

// Write the header row
out_at.set_entry(r, c++, "COL_NAME:");

Expand All @@ -3412,7 +3418,7 @@ void TCStatJobRIRW::do_ctc_output(ostream &out) {
out_at.set_entry(r, c++, ByColumn[i]);
}

// Write the header columns
// Write the header columns
write_header_row(ctc_columns, n_ctc_columns, 0, out_at, r, c);

// Loop over the map entries and populate the output table
Expand Down

0 comments on commit c0ae655

Please sign in to comment.