public class PerfReporter extends Formatter
Test directories are given as command line arguments. If none are specified, a report is generated for the current working directory.
The trim specifications are looked up in "trim.spec" in the test directory. If not found, all trim specifications used by the test are assumed to encompass the lifetime of each associated statistic. To alter the trim used by a test, this file must exist and contain the desired endpoints.
The statistics specifications are looked up in "statistics.spec" in the test directory. If not found, the default statistics in this package are used. To alter the statistics specification used to generate a performance report, this file can either be edited in place or overridden via the system property "-DstatSpecFile". In the latter case, the statistics specification applies to all tests for which reports are being generated.
Any system properties used in the specification files must be specified on the command line if they do not already exist in a .prop file by the same name and in the same directory as the test, whether that is relative to the current directory or to $JTESTS.
The statistics archives for each test are located by first searching in
system directories by the names GemFirePrms.names in the test
directory. If a system directory for a given name is not found, the
reporter looks in the location specified by HostPrms.resourceDirBases.
Usage:
java -classpath $JTESTS:$GEMFIRE/lib/gemfire.jar
-Dgemfire.home=<path_to_gemfire_product_tree>
-DJTESTS=<path_to_test_classes>
[-DstatSpecFile=<stat_spec_filename>]
[-DperfReportFile=<perf_report_filename>]
[-DlogLevel=<perf_reporter_log_level(default:info)>]
[-DBrief=<brief_summar_report(default:false)>]
[-DuseWorkaround=<use_workaround_for_bug_30288(default:true)>]
[user_defined_system_properties]
perffmwk.PerfReporter
[<test_directories>]
Example:
java -classpath $JTESTS:$GEMFIRE/lib/gemfire.jar
-Dgemfire.home=$GEMFIRE
-DJTESTS=$JTESTS
perffmwk.PerfReporter mytest-081303-* yourtest-081303-*
Logging by the performance reporter is written to "perfreporter.log".
The verbosity of this log is controlled via the logLevel
system property (see LogWriter.
The performance report for each test is written to "perfreport.txt" in
the test directory unless overridden with the system property
"-DperfReportFile". Any previously generated reports with the same name
are overwritten. Note that if perfReportFile denotes an
absolute file path, then the report
will not be placed in the test directory. Note also that if the
perfReportFile is -, then report will be
printed to standard out.
If useWorkaround is true (default), a workaround is used for
Bug 30288 to allow active stats to flush to the archive.
A "brief" performance report (specified with the "Brief" system property) excludes "test dependent" information such as the trim values and the statistics spec. Instead, it contains a description of the statistics followed by their measured values.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
brief
Is a "brief" report being generated?
author David Whitlock
|
protected static String |
LATEST_PROP_FILE_NAME
The name of the file from which to read the latest properties
|
static String |
PERFORMANCE_REPORT_FILE_NAME
The name of the file to which to write performance data
|
protected static String |
STAT_SPEC_FILE_NAME
The name of the file to which to write statistics specifications
|
protected static String |
TRIM_SPEC_FILE_NAME
The name of the file to which to write trim specifications
|
DIVIDER, SUBDIVIDER, WIDTH| Constructor and Description |
|---|
PerfReporter() |
| Modifier and Type | Method and Description |
|---|---|
protected static StatConfig |
getStatConfig(String testDir,
String statFile)
Used by
PerfComparer to create a StatConfig
for the test run that resides in the given test output directory. |
protected static SortedMap |
getStatValues(StatConfig statconfig)
Returns a map that maps the name of statistics spec to a list of
PerfStatValues for that spec. |
static void |
main(String[] args) |
protected static void |
printStatisticsValues(StatConfig statconfig,
SortedMap statvalues,
PrintWriter pw)
Adds all statistics and their values to the report.
|
protected static void |
printStatReport(StatConfig statconfig,
String report) |
static boolean |
runperfreport(String[] args) |
protected static final String LATEST_PROP_FILE_NAME
protected static final String TRIM_SPEC_FILE_NAME
protected static final String STAT_SPEC_FILE_NAME
public static final String PERFORMANCE_REPORT_FILE_NAME
public static boolean brief
public static void main(String[] args)
public static boolean runperfreport(String[] args)
protected static StatConfig getStatConfig(String testDir, String statFile)
PerfComparer to create a StatConfig
for the test run that resides in the given test output directory.protected static SortedMap getStatValues(StatConfig statconfig)
PerfStatValues for that spec.protected static void printStatReport(StatConfig statconfig, String report)
protected static void printStatisticsValues(StatConfig statconfig, SortedMap statvalues, PrintWriter pw)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.