public class PRTimeReporter extends Object implements BenchmarkReportable
Modifier and Type | Field and Description |
---|---|
static String |
MEDIA_HTML
This string constant when set as print media indicates that the report is
printed in HTML format.
|
static String |
MEDIA_TEXT
This string constant when set as print media indicates that the report is
printed in TEXT format.
|
HashSet<String> |
pipelineNames
Names of the given pipeline for which the entries are present in given
benchmark file.
|
static String |
SORT_EXEC_ORDER
This string constant when set as sort order indicates that the processing
elements are sorted in the order of their execution.
|
static String |
SORT_TIME_TAKEN
This string constant when set as sort order indicates that the processing
elements are sorted in the descending order of processing time taken by a
particular element.
|
int |
validEntries
An integer containing the count of total valid log entries present in input
file provided.
|
Constructor and Description |
---|
PRTimeReporter()
No Argument constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
calculate(Object reportContainer)
Calculates the sub totals at each level.
|
void |
executeReport()
A single method to execute report (A command line counter part API ).
|
File |
getBenchmarkFile() |
String |
getLogicalStart()
Returns the marker indicating logical start of a run.
|
String |
getPrintMedia()
Returns the name of the media on which report will be generated.
|
File |
getReportFile() |
String |
getSortOrder()
Returns the sorting order specified for the report (EXEC_ORDER or
TIME_TAKEN).
|
boolean |
isSuppressZeroTimeEntries()
Returns the flag indicating whether or not to suppress the processing
elements from the report which took 0 milliseconds.
|
static void |
main(String[] args)
A main method which acts as a entry point while executing a report via
command line.
|
void |
parseArguments(String[] args)
Parses the report arguments.
|
void |
printReport(Object reportSource,
File outputFile)
Prints a report as per the value provided for print media option.
|
void |
setBenchmarkFile(File benchmarkFile)
Sets the input benchmark file from which the report is generated.
|
void |
setLogicalStart(String logicalStart)
Sets optionally a string indicating the logical start of a run.
|
void |
setPrintMedia(String printMedia)
Sets the media on which report will be generated.
|
void |
setReportFile(File reportFile)
If not set, the default is the file name "report.txt/html"
in the system temporary directory.
|
void |
setSortOrder(String sortOrder)
Sets the sorting order of the report.
|
void |
setSuppressZeroTimeEntries(boolean suppressZeroTimeEntries)
Allow to suppress the processing elements from the report which
took 0 milliseconds.
|
Object |
store(File inputFile)
Stores GATE processing elements and the time taken by them in an in-memory
data structure for report generation.
|
static void |
usage()
Display a usage message
|
public static final String MEDIA_TEXT
public static final String MEDIA_HTML
public static final String SORT_EXEC_ORDER
public static final String SORT_TIME_TAKEN
public int validEntries
public Object store(File inputFile) throws BenchmarkReportInputFileFormatException
store
in interface BenchmarkReportable
inputFile
- A File handle of the input log file.BenchmarkReportInputFileFormatException
public Object calculate(Object reportContainer)
calculate
in interface BenchmarkReportable
reportContainer
- An Object of type LinkedHashMap<String, Object> containing the
processing elements (with time in milliseconds) in hierarchical
structure.public void printReport(Object reportSource, File outputFile)
printReport
in interface BenchmarkReportable
reportSource
- An Object of type LinkedHashMap<String, Object> containing the
processing elements (with time in milliseconds) in hierarchical
structure.outputFile
- Path where to save the report.public void parseArguments(String[] args)
parseArguments
in interface BenchmarkReportable
args
- A string array containing the command line arguments.public static void usage()
public static void main(String[] args) throws BenchmarkReportInputFileFormatException
args
- A string array containing the command line arguments.BenchmarkReportInputFileFormatException
public void executeReport() throws BenchmarkReportInputFileFormatException
BenchmarkReportable
executeReport
in interface BenchmarkReportable
BenchmarkReportInputFileFormatException
public boolean isSuppressZeroTimeEntries()
public void setSuppressZeroTimeEntries(boolean suppressZeroTimeEntries)
suppressZeroTimeEntries
- if true suppress zero time entries.
This Parameter is ignored if SortOrder specified is
SORT_TIME_TAKEN
. True by default.public String getPrintMedia()
public void setPrintMedia(String printMedia)
printMedia
- Type of media on which the report will be generated.
Must be MEDIA_TEXT or MEDIA_HTML.
The default is MEDIA_HTML.public String getSortOrder()
public void setSortOrder(String sortOrder)
sortOrder
- Sorting order of the report.
Must be SORT_EXEC_ORDER or SORT_TIME_TAKEN.
Default is SORT_EXEC_ORDER
.public String getLogicalStart()
public void setLogicalStart(String logicalStart)
logicalStart
- A String indicating the logical start of a run.
Useful when you you have marked different runs in
your benchmark file with this string at their start.
By default the value is null.public File getBenchmarkFile()
setBenchmarkFile(java.io.File)
public void setBenchmarkFile(File benchmarkFile)
benchmarkFile
- Input benchmark file.public File getReportFile()
setReportFile(java.io.File)
public void setReportFile(File reportFile)
reportFile
- file path to the report file to write.Copyright © 2024 GATE. All rights reserved.