Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: pkg/analysis_server/test/performance/main.dart

Issue 1201263002: performance measurement: add explicit temp source directory argument (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/performance/log_file_input_converter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/performance/main.dart
diff --git a/pkg/analysis_server/test/performance/main.dart b/pkg/analysis_server/test/performance/main.dart
index 9d085fc40d070e58c085a85d2bd2cbb1e0fde5de..563533103feed6e455185c82a360c7b8743b7c24 100644
--- a/pkg/analysis_server/test/performance/main.dart
+++ b/pkg/analysis_server/test/performance/main.dart
@@ -61,6 +61,7 @@ const HELP_CMDLINE_OPTION = 'help';
const INPUT_CMDLINE_OPTION = 'input';
const MAP_FROM_OPTION = 'mapFrom';
const MAP_TO_OPTION = 'mapTo';
+const TMP_SRC_DIR_OPTION = 'tmpSrcDir';
const VERBOSE_CMDLINE_OPTION = 'verbose';
const VERY_VERBOSE_CMDLINE_OPTION = 'vv';
@@ -69,6 +70,7 @@ const VERY_VERBOSE_CMDLINE_OPTION = 'vv';
* should interact with the analysis server.
*/
Stream<Operation> openInput(ArgResults args) {
+ var logger = new Logger('openInput');
Stream<List<int>> inputRaw;
String inputPath = args[INPUT_CMDLINE_OPTION];
if (inputPath == null) {
@@ -84,13 +86,15 @@ Stream<Operation> openInput(ArgResults args) {
if (mapFrom != null && mapFrom.isNotEmpty) {
String mapTo = args[MAP_TO_OPTION];
srcPathMap[mapFrom] = mapTo;
- new Logger('openInput').log(
+ logger.log(
Level.INFO, 'mapping source paths\n from $mapFrom\n to $mapTo');
}
+ String tmpSrcDirPath = args[TMP_SRC_DIR_OPTION];
+ logger.log(Level.INFO, 'tmpSrcDir: $tmpSrcDirPath');
return inputRaw
.transform(SYSTEM_ENCODING.decoder)
.transform(new LineSplitter())
- .transform(new InputConverter(srcPathMap));
+ .transform(new InputConverter(tmpSrcDirPath, srcPathMap));
}
/**
@@ -99,17 +103,18 @@ Stream<Operation> openInput(ArgResults args) {
ArgResults parseArgs(List<String> rawArgs) {
ArgParser parser = new ArgParser();
- parser.addOption(INPUT_CMDLINE_OPTION,
- abbr: 'i',
- help: 'The input file specifying how this client should interact '
- 'with the server. If the input file name is "stdin", '
- 'then the instructions are read from standard input.');
+ parser.addOption(INPUT_CMDLINE_OPTION, abbr: 'i', help: '<filePath>\n'
+ 'The input file specifying how this client should interact with the server.\n'
+ 'If the input file name is "stdin", then the instructions are read from standard input.');
parser.addOption(MAP_FROM_OPTION,
help: 'The original source directory when the instrumentation '
'or log file was generated.');
parser.addOption(MAP_TO_OPTION,
help: 'The target source directory used during performance testing. '
'WARNING: The contents of this directory will be modified');
+ parser.addOption(TMP_SRC_DIR_OPTION, abbr: 't', help: '<dirPath>\n'
+ 'The temporary directory containing source used during performance measurement.\n'
+ 'WARNING: The contents of the target directory will be modified');
parser.addFlag(VERBOSE_CMDLINE_OPTION,
abbr: 'v', help: 'Verbose logging', negatable: false);
parser.addFlag(VERY_VERBOSE_CMDLINE_OPTION,
@@ -131,7 +136,7 @@ ArgResults parseArgs(List<String> rawArgs) {
bool isMissing(key) => args[key] == null || args[key].isEmpty;
if (isMissing(INPUT_CMDLINE_OPTION)) {
- print('missing "input" argument');
+ print('missing $INPUT_CMDLINE_OPTION argument');
showHelp = true;
}
@@ -140,6 +145,11 @@ ArgResults parseArgs(List<String> rawArgs) {
showHelp = true;
}
+ if (isMissing(TMP_SRC_DIR_OPTION)) {
+ print('missing $TMP_SRC_DIR_OPTION argument');
+ showHelp = true;
+ }
+
if (args[VERY_VERBOSE_CMDLINE_OPTION] || rawArgs.contains('-vv')) {
Logger.root.level = Level.FINE;
} else if (args[VERBOSE_CMDLINE_OPTION]) {
@@ -159,5 +169,6 @@ ArgResults parseArgs(List<String> rawArgs) {
void printHelp(ArgParser parser) {
print('');
print('Launch and interact with the AnalysisServer');
+ print('');
print(parser.usage);
}
« no previous file with comments | « pkg/analysis_server/test/performance/log_file_input_converter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698