public class DocTimeReporter extends Object implements BenchmarkReportable
Modifier and Type | Field and Description |
---|---|
static int |
ALL_DOCS
This integer constant when set as No of Docs indicates that the report have
all the documents matching a given PR.
|
static String |
MATCH_ALL_PR_REGEX
The default value for search string matching PRs for given run.
|
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.
|
int |
validEntries
An integer containing the count of total valid log entries present in input
file provided.
|
Constructor and Description |
---|
DocTimeReporter()
No argument constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
calculate(Object reportContainer)
Calculates the total of the time taken by processing element at each leaf
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.
|
int |
getMaxDocumentInReport()
Returns the maximum no of documents to be shown in the report.
|
String |
getPrintMedia()
Returns the name of the media on which report will be generated.
|
String |
getPRMatchingRegex()
Returns the search string to be matched to PR names present in the log
entries.
|
File |
getReportFile() |
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 command lime 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 |
setMaxDocumentInReport(int maxDocumentInReport)
Maximum number of documents contained in the report.
|
void |
setPrintMedia(String printMedia)
Sets the media on which report will be generated.
|
void |
setPRMatchingRegex(String matchingRegex)
Search string to match PR names present in the benchmark file.
|
void |
setReportFile(File reportFile)
If not set, the default is the file name "report.txt/html"
in the system temporary directory.
|
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 int validEntries
public static final String MEDIA_TEXT
public static final String MEDIA_HTML
public static final int ALL_DOCS
public static final String MATCH_ALL_PR_REGEX
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 Object store(File inputFile) throws BenchmarkReportInputFileFormatException
store
in interface BenchmarkReportable
inputFile
- A handle to the input benchmark file.BenchmarkReportInputFileFormatException
- if the input file provided is not a valid benchmark file.public void parseArguments(String[] args)
parseArguments
in interface BenchmarkReportable
args
- array containing the command line arguments.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 static void usage()
public static void main(String[] args) throws BenchmarkReportInputFileFormatException, BenchmarkReportFileAccessException
args
- A string array containing the command line arguments.BenchmarkReportExecutionException
- if a given input file is modified while generating the report.BenchmarkReportInputFileFormatException
BenchmarkReportFileAccessException
public void executeReport() throws BenchmarkReportInputFileFormatException, BenchmarkReportFileAccessException
BenchmarkReportable
executeReport
in interface BenchmarkReportable
BenchmarkReportInputFileFormatException
BenchmarkReportFileAccessException
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.public int getMaxDocumentInReport()
public void setMaxDocumentInReport(int maxDocumentInReport)
maxDocumentInReport
- Maximum number of documents contained in
the report. Use the constant ALL_DOCS for reporting all documents.
The default is 10.public String getPRMatchingRegex()
public void setPRMatchingRegex(String matchingRegex)
matchingRegex
- regular expression to match PR names
present in the benchmark file. The default is MATCH_ALL_PR_REGEX.Copyright © 2024 GATE. All rights reserved.