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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/elements/heap_profile.dart

Issue 217323006: Redo allocationprofile options (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | runtime/vm/json_stream.h » ('j') | 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 heap_profile_element; 5 library heap_profile_element;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'observatory_element.dart'; 8 import 'observatory_element.dart';
9 import 'package:observatory/service.dart'; 9 import 'package:observatory/service.dart';
10 import 'package:logging/logging.dart'; 10 import 'package:logging/logging.dart';
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 profile = response; 234 profile = response;
235 }).catchError((e, st) { 235 }).catchError((e, st) {
236 Logger.root.info('$e $st'); 236 Logger.root.info('$e $st');
237 }).whenComplete(done); 237 }).whenComplete(done);
238 } 238 }
239 239
240 void resetAccumulator(Event e, var detail, Node target) { 240 void resetAccumulator(Event e, var detail, Node target) {
241 if (profile == null) { 241 if (profile == null) {
242 return; 242 return;
243 } 243 }
244 profile.isolate.get('/allocationprofile/reset').then((ServiceMap response) { 244 var isolate = profile.isolate;
245 isolate.get('/allocationprofile?reset=true').then((ServiceMap response) {
245 assert(response['type'] == 'AllocationProfile'); 246 assert(response['type'] == 'AllocationProfile');
246 profile = response; 247 profile = response;
247 }).catchError((e, st) { 248 }).catchError((e, st) {
248 Logger.root.info('$e $st'); 249 Logger.root.info('$e $st');
249 }); 250 });
250 } 251 }
251 252
252 void profileChanged(oldValue) { 253 void profileChanged(oldValue) {
253 _updateChartData(); 254 _updateChartData();
254 notifyPropertyChange(#formattedAverage, [], formattedAverage); 255 notifyPropertyChange(#formattedAverage, [], formattedAverage);
(...skipping 23 matching lines...) Expand all
278 279
279 @observable String formattedTotalCollectionTime(bool newSpace) { 280 @observable String formattedTotalCollectionTime(bool newSpace) {
280 if (profile == null) { 281 if (profile == null) {
281 return ''; 282 return '';
282 } 283 }
283 String space = newSpace ? 'new' : 'old'; 284 String space = newSpace ? 'new' : 'old';
284 Map heap = profile['heaps'][space]; 285 Map heap = profile['heaps'][space];
285 return '${formatSeconds(heap['time'])} secs'; 286 return '${formatSeconds(heap['time'])} secs';
286 } 287 }
287 } 288 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698