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

Side by Side Diff: sdk/lib/profiler/profiler.dart

Issue 886353006: Port metrics to RPC (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « runtime/vm/service/service.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dart.profiler; 5 library dart.profiler;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 /// A UserTag can be used to group samples in the Observatory profiler. 9 /// A UserTag can be used to group samples in the Observatory profiler.
10 abstract class UserTag { 10 abstract class UserTag {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 static String _printMetric(String id) { 180 static String _printMetric(String id) {
181 var metric = _metrics[id]; 181 var metric = _metrics[id];
182 if (metric == null) { 182 if (metric == null) {
183 return null; 183 return null;
184 } 184 }
185 return JSON.encode(metric._toJSON()); 185 return JSON.encode(metric._toJSON());
186 } 186 }
187 187
188 static String _printMetrics() { 188 static String _printMetrics() {
189 var members = []; 189 var metrics = [];
190 for (var metric in _metrics.values) { 190 for (var metric in _metrics.values) {
191 members.add(metric._toJSON()); 191 metrics.add(metric._toJSON());
192 } 192 }
193 var map = { 193 var map = {
194 'type': 'MetricList', 194 'type': 'MetricList',
195 'id': 'metrics', 195 'metrics': metrics,
196 'members': members,
197 }; 196 };
198 return JSON.encode(map); 197 return JSON.encode(map);
199 } 198 }
200 } 199 }
OLDNEW
« no previous file with comments | « runtime/vm/service/service.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698