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

Side by Side Diff: pkg/analyzer/lib/instrumentation/instrumentation.dart

Issue 859513002: send priority instrumentation message on startup with version info (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debugging code Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library instrumentation; 5 library instrumentation;
6 6
7 /** 7 /**
8 * A container with analysis performance constants. 8 * A container with analysis performance constants.
9 */ 9 */
10 class AnalysisPerformanceKind { 10 class AnalysisPerformanceKind {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 new InstrumentationService(null); 54 new InstrumentationService(null);
55 55
56 static const String TAG_ERROR = 'Err'; 56 static const String TAG_ERROR = 'Err';
57 static const String TAG_EXCEPTION = 'Ex'; 57 static const String TAG_EXCEPTION = 'Ex';
58 static const String TAG_FILE_READ = 'Read'; 58 static const String TAG_FILE_READ = 'Read';
59 static const String TAG_LOG_ENTRY = 'Log'; 59 static const String TAG_LOG_ENTRY = 'Log';
60 static const String TAG_NOTIFICATION = 'Noti'; 60 static const String TAG_NOTIFICATION = 'Noti';
61 static const String TAG_PERFORMANCE = 'Perf'; 61 static const String TAG_PERFORMANCE = 'Perf';
62 static const String TAG_REQUEST = 'Req'; 62 static const String TAG_REQUEST = 'Req';
63 static const String TAG_RESPONSE = 'Res'; 63 static const String TAG_RESPONSE = 'Res';
64 static const String TAG_STARTUP = 'Startup';
Brian Wilkerson 2015/01/16 19:48:28 This is what "TAG_VERSION" was added for.
danrubel 2015/01/20 17:23:54 Good to know. Switched to using that instead.
64 static const String TAG_VERSION = 'Ver'; 65 static const String TAG_VERSION = 'Ver';
65 66
66 /** 67 /**
67 * The instrumentation server used to communicate with the server, or `null` 68 * The instrumentation server used to communicate with the server, or `null`
68 * if instrumentation data should not be logged. 69 * if instrumentation data should not be logged.
69 */ 70 */
70 InstrumentationServer _instrumentationServer; 71 InstrumentationServer _instrumentationServer;
71 72
72 /** 73 /**
73 * Initialize a newly created instrumentation service to comunicate with the 74 * Initialize a newly created instrumentation service to comunicate with the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 172 }
172 173
173 /** 174 /**
174 * Log that a response has been sent to the client. 175 * Log that a response has been sent to the client.
175 */ 176 */
176 void logResponse(String response) { 177 void logResponse(String response) {
177 _log(TAG_RESPONSE, response); 178 _log(TAG_RESPONSE, response);
178 } 179 }
179 180
180 /** 181 /**
182 * Signal that the client has started analysis server.
183 * This method should be invoked exactly one time.
184 */
185 void logVersion(String uuid, String clientId, String clientVersion,
186 String serverVersion, String sdkVersion) {
187
188 String normalize(String value) =>
189 value != null && value.length > 0 ? value : 'unknown';
190
191 if (_instrumentationServer != null) {
192 _instrumentationServer.logWithPriority(
193 _join(
194 [
195 TAG_STARTUP,
196 uuid,
197 normalize(clientId),
198 normalize(clientVersion),
199 serverVersion,
200 sdkVersion]));
201 }
202 }
203
204 /**
181 * Signal that the client is done communicating with the instrumentation 205 * Signal that the client is done communicating with the instrumentation
182 * server. This method should be invoked exactly one time and no other methods 206 * server. This method should be invoked exactly one time and no other methods
183 * should be invoked on this instance after this method has been invoked. 207 * should be invoked on this instance after this method has been invoked.
184 */ 208 */
185 void shutdown() { 209 void shutdown() {
186 if (_instrumentationServer != null) { 210 if (_instrumentationServer != null) {
187 _instrumentationServer.shutdown(); 211 _instrumentationServer.shutdown();
188 _instrumentationServer = null; 212 _instrumentationServer = null;
189 } 213 }
190 } 214 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 288 }
265 } 289 }
266 290
267 @override 291 @override
268 void shutdown() { 292 void shutdown() {
269 for (InstrumentationServer server in _servers) { 293 for (InstrumentationServer server in _servers) {
270 server.shutdown(); 294 server.shutdown();
271 } 295 }
272 } 296 }
273 } 297 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698