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

Unified Diff: pkg/analysis_server/test/integration/integration_tests.dart

Issue 1163713005: analysis server performance measurement driver first cut (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | pkg/analysis_server/test/performance/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/integration/integration_tests.dart
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index 23592862cbc7229cd5ffbb5aac3bdbd98837b934..98e986034afaa11068e1f0e18eebd1a70973d1d1 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -428,6 +428,17 @@ class Server {
Stopwatch _time = new Stopwatch();
/**
+ * The [currentElapseTime] at which the last communication was received from the server
+ * or `null` if no communication has been received.
+ */
+ double lastCommunicationTime;
+
+ /**
+ * The current elapse time (seconds) since the server was started.
+ */
+ double get currentElapseTime => _time.elapsedTicks / _time.frequency;
+
+ /**
* Future that completes when the server process exits.
*/
Future<int> get exitCode => _process.exitCode;
@@ -488,6 +499,7 @@ class Server {
.transform((new Utf8Codec()).decoder)
.transform(new LineSplitter())
.listen((String line) {
+ lastCommunicationTime = currentElapseTime;
String trimmedLine = line.trim();
_recordStdio('RECV: $trimmedLine');
var message;
@@ -630,7 +642,7 @@ class Server {
* [debugStdio] has been called.
*/
void _recordStdio(String line) {
- double elapsedTime = _time.elapsedTicks / _time.frequency;
+ double elapsedTime = currentElapseTime;
line = "$elapsedTime: $line";
if (_debuggingStdio) {
print(line);
« no previous file with comments | « no previous file | pkg/analysis_server/test/performance/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698