USGS

Isis 3.0 Application Source Code Reference

Home

ProgramAnalyzer Class Reference

A ProgramAnalyzer accumulates print log runtime statistics. More...

#include <ProgramAnalyzer.h>

List of all members.

Classes

struct  ProgramData
 Container for program data.
struct  RunTimeStats
 Container for runtime status of a programs.

Public Member Functions

 ProgramAnalyzer ()
 Default constructor.
 ProgramAnalyzer (const QString &logfile)
 Analyzes the given log file on construction.
virtual ~ProgramAnalyzer ()
 Destructor ensures everything is cleaned up properly.
int count () const
 Returns total number of programs analyzed.
int size () const
 Returns the total number of analyzed programs.
int valid () const
 Returns the number of valid programs.
int errors () const
 Returns the number of programs with errors.
int nodata () const
 Returns the number of programs with incomplete data.
int baddata () const
 Returns the number of programs that had bad/invalid data.
int zerotime () const
 Returns the number of programs that had zero CPU or run times.
int Programs () const
 Returns total number of unique programs.
void setExclude (const QString &name)
 Set the list of program exclusions.
void exclude (const QString &exclude)
 Loads a list of excluded program names from a file.
void setInclude (const QString &name)
 Set the list of program inclusions.
void include (const QString &include)
 Loads a list of included program names from a file.
void add (const QString &logfile)
 Adds a print.prt file to the analysis.
void add (PvlObject &program)
 Adds a program object originating from a print.prt file.
PvlGroup review (const QString &name="Results") const
 Reports program counters for the current state.
PvlGroup cumulative (const QString &name="ProgramTotals") const
 Reports cumulative runtime performance statistics for programs.
PvlGroup summarize (const QString &name) const
 Reports analysis for a specific program.
PvlGroup summarize (const int index) const
 Reports analysis for the nth occuring application in the list.
std::ostream & header (std::ostream &out) const
std::ostream & listify (std::ostream &out) const

Detailed Description

A ProgramAnalyzer accumulates print log runtime statistics.

This class reads an ISIS3 print log and accumulates runtime statistics for all programs found in the log file. It will compute overall CPU and connect time to use in analysis of (typically I/O) performance.

Various format and reporting utilities are provided to externalize the results.

Author:
2006-11-09 Kris Becker

Definition at line 54 of file ProgramAnalyzer.h.


Constructor & Destructor Documentation

ProgramAnalyzer (  ) 

Default constructor.

Definition at line 42 of file ProgramAnalyzer.cpp.

ProgramAnalyzer ( const QString &  logfile  ) 

Analyzes the given log file on construction.

Parameters:
logfile A print.prt file

Definition at line 51 of file ProgramAnalyzer.cpp.

virtual ~ProgramAnalyzer (  )  [inline, virtual]

Destructor ensures everything is cleaned up properly.

Definition at line 62 of file ProgramAnalyzer.h.


Member Function Documentation

int count (  )  const [inline]

Returns total number of programs analyzed.

Definition at line 65 of file ProgramAnalyzer.h.

int size (  )  const [inline]

Returns the total number of analyzed programs.

Definition at line 67 of file ProgramAnalyzer.h.

int valid (  )  const [inline]

Returns the number of valid programs.

Definition at line 69 of file ProgramAnalyzer.h.

int errors (  )  const [inline]

Returns the number of programs with errors.

Definition at line 71 of file ProgramAnalyzer.h.

int nodata (  )  const [inline]

Returns the number of programs with incomplete data.

Definition at line 73 of file ProgramAnalyzer.h.

int baddata (  )  const [inline]

Returns the number of programs that had bad/invalid data.

Definition at line 75 of file ProgramAnalyzer.h.

int zerotime (  )  const [inline]

Returns the number of programs that had zero CPU or run times.

Definition at line 77 of file ProgramAnalyzer.h.

int Programs (  )  const [inline]

Returns total number of unique programs.

Definition at line 80 of file ProgramAnalyzer.h.

void setExclude ( const QString &  name  ) 

Set the list of program exclusions.

When provided, the QString should contain names of ISIS programs that will be excluded in the analysis. If more than one program is desired, separate them by commas.

The exclusion list takes precedence over any applications added in the inclusion list. In other words, if the same program is included in both the inclusion and exclusion list, it will be excluded.

Note this method can be called repeatedly to add names.

Parameters:
name Comma separated list of names of programs to exclude

Definition at line 71 of file ProgramAnalyzer.cpp.

void exclude ( const QString &  name  ) 

Loads a list of excluded program names from a file.

The file is expected to contain the name of an ISIS program, one per line. These programs will be logged but not included in the analysis.

The exclusion list takes precedence over any applications added in the inclusion list. In other words, if the same program is included in both the inclusion and exclusion list, it will be excluded.

Note this method can be called repeatedly to add names.

Parameters:
name Name of file containing program list to exclude

Definition at line 91 of file ProgramAnalyzer.cpp.

void setInclude ( const QString &  name  ) 

Set the list of program inclusions.

When provided, the QString should contain names of ISIS programs that will be included in the analysis. If more than one program is desired, separate them by commas.

If this option is used, it will only included programs given in this list. It operates as both an inclusive and exclusive list, so there is no need to also utilize the exclude features of this class.

However, if you do use the exclusion features of this clas, the exclusion list takes precedence over any applications added in the inclusion list. In other words, if the same program is included in both the inclusion and exclusion list, it will be excluded.

Note this method can be called repeatedly to add names.

Parameters:
name Comma separated list of names of programs to include

Definition at line 120 of file ProgramAnalyzer.cpp.

void include ( const QString &  name  ) 

Loads a list of included program names from a file.

The file is expected to contain the name of an ISIS program, one per line. These programs will be included in the analysis.

If this option is used, it will only included programs given in this list. It operates as both an inclusive and exclusive list, so there is no need to also utilize the exclude features of this class.

However, if you do use the exclusion feartures, the exclusion list takes precedence over any applications added in the inclusion list. In other words, if the same program is included in both the inclusion and exclusion list, it will be excluded.

Note this method can be called repeatedly to add names.

Parameters:
name Name of file containing program list to include

Definition at line 145 of file ProgramAnalyzer.cpp.

void add ( const QString &  logfile  ) 

Adds a print.prt file to the analysis.

The programs contained in the log file, assumed to be a print.prt file, will be added to the list of programs to be analyzed. They are subject to the exclude and include program lists.

Parameters:
logfile An ISIS3 print.prt file

Definition at line 162 of file ProgramAnalyzer.cpp.

void add ( PvlObject &  program  ) 

Adds a program object originating from a print.prt file.

The PvlObject provided is assumed to orginate from an ISIS3 print.prt log file. It contains information that will be extracted and analyzed according to the features of this class.

Parameters:
program Pvl object containing the output log of an ISIS3 application

Definition at line 179 of file ProgramAnalyzer.cpp.

PvlGroup review ( const QString &  name = "Results"  )  const

Reports program counters for the current state.

This method reports counts of programs as they were added to the object. It reports total programs, numbers for analyzed, included, excluded, unique, valid, errors, zero CPU/Connect times and incomplete or invalid (typcially negative times) for programs it evaluted.

Parameters:
name Name of Pvl group to create
Returns:
PvlGroup Pvl group containing program numbers/counts

Definition at line 216 of file ProgramAnalyzer.cpp.

PvlGroup cumulative ( const QString &  name = "ProgramTotals"  )  const

Reports cumulative runtime performance statistics for programs.

This method formats the contents of the program analysis in a Pvl group that provides information for all programs regardin CPU, connect and I/O times.

Parameters:
name Name of Pvl group to create
Returns:
PvlGroup Pvl group containing cumulative program analysis

Definition at line 244 of file ProgramAnalyzer.cpp.

PvlGroup summarize ( const QString &  name  )  const

Reports analysis for a specific program.

This object maintains individual statistics for each unique program. This method reports the analysis for a particular program.

Parameters:
name Name of the program to analyze
Returns:
PvlGroup Pvl group containing program analysis

Definition at line 259 of file ProgramAnalyzer.cpp.

PvlGroup summarize ( const int  index  )  const

Reports analysis for the nth occuring application in the list.

This object maintains individual statistics for each unique program. This method reports the analysis for a program that occurs in the list at the given index.

Parameters:
index Index of the application to summerize
Returns:
PvlGroup Pvl group containing the program analysis

Definition at line 274 of file ProgramAnalyzer.cpp.

std::ostream& header ( std::ostream &  out  )  const
std::ostream& listify ( std::ostream &  out  )  const

The documentation for this class was generated from the following files: