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

Unified Diff: runtime/bin/vmservice/client/lib/src/service/object.dart

Issue 342513004: Visual refresh of allocation profile page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: runtime/bin/vmservice/client/lib/src/service/object.dart
diff --git a/runtime/bin/vmservice/client/lib/src/service/object.dart b/runtime/bin/vmservice/client/lib/src/service/object.dart
index 967907cdec016b9647993ae8554f43007e6c0a21..1b952ab2f36938bdd6e3b647246e6f32e72ebd9f 100644
--- a/runtime/bin/vmservice/client/lib/src/service/object.dart
+++ b/runtime/bin/vmservice/client/lib/src/service/object.dart
@@ -190,6 +190,7 @@ abstract class VM extends ServiceObjectOwner {
@observable double uptime = 0.0;
@observable bool assertsEnabled = false;
@observable bool typeChecksEnabled = false;
+ @observable DateTime date;
koda 2014/06/17 21:04:07 Please choose a more descriptive name. lastUpdated
Cutch 2014/06/18 14:35:03 Done.
VM() : super._empty(null) {
name = 'vm';
@@ -373,6 +374,8 @@ abstract class VM extends ServiceObjectOwner {
version = map['version'];
architecture = map['architecture'];
uptime = map['uptime'];
+ var dateInMillis = int.parse(map['date']);
+ date = new DateTime.fromMillisecondsSinceEpoch(dateInMillis);
assertsEnabled = map['assertsEnabled'];
typeChecksEnabled = map['typeChecksEnabled'];
_updateIsolates(map['isolates']);
@@ -660,14 +663,25 @@ class Isolate extends ServiceObjectOwner {
toObservable(new Map<String, double>());
@observable int newHeapUsed = 0;
koda 2014/06/17 21:04:06 The same three fields are repeated for new and old
Cutch 2014/06/18 14:35:03 Done.
- @observable int oldHeapUsed = 0;
@observable int newHeapCapacity = 0;
+ @observable int newExternal = 0;
+ @observable int oldHeapUsed = 0;
@observable int oldHeapCapacity = 0;
+ @observable int oldExternal = 0;
@observable String fileAndLine;
@observable DartError error;
+ void updateHeapsFromMap(ObservableMap map) {
+ newHeapUsed = map['new']['used'];
+ newHeapCapacity = map['new']['capacity'];
+ newExternal = map['new']['external'];
+ oldHeapUsed = map['old']['used'];
+ oldHeapCapacity = map['old']['capacity'];
+ oldExternal = map['old']['external'];
+ }
+
void _update(ObservableMap map, bool mapIsRef) {
mainPort = map['mainPort'];
name = map['name'];
@@ -680,7 +694,7 @@ class Isolate extends ServiceObjectOwner {
_upgradeCollection(map, isolate);
if (map['rootLib'] == null ||
map['timers'] == null ||
- map['heap'] == null) {
+ map['heaps'] == null) {
Logger.root.severe("Malformed 'Isolate' response: $map");
return;
}
@@ -729,10 +743,7 @@ class Isolate extends ServiceObjectOwner {
timerMap['time_bootstrap']);
timers['dart'] = timerMap['time_dart_execution'];
- newHeapUsed = map['heap']['usedNew'];
- oldHeapUsed = map['heap']['usedOld'];
- newHeapCapacity = map['heap']['capacityNew'];
- oldHeapCapacity = map['heap']['capacityOld'];
+ updateHeapsFromMap(map['heaps']);
List features = map['features'];
if (features != null) {
@@ -972,6 +983,18 @@ class Library extends ServiceObject {
}
}
+class AllocationStat extends Observable {
koda 2014/06/17 21:04:06 Consider adding pointer to the C++ counterpart in
Cutch 2014/06/18 14:35:03 Done.
+ @observable int instances = 0;
+ @observable int bytes = 0;
+
+ void reset() {
+ instances = 0;
+ bytes = 0;
+ }
+
+ bool get empty => (instances == 0) && (bytes == 0);
+}
+
class Class extends ServiceObject {
@observable Library library;
@observable Script script;
@@ -987,6 +1010,18 @@ class Class extends ServiceObject {
@observable ServiceMap error;
+ final AllocationStat accumulatedNewSpace = new AllocationStat();
+ final AllocationStat accumulatedOldSpace = new AllocationStat();
+ final AllocationStat currentNewSpace = new AllocationStat();
+ final AllocationStat currentOldSpace = new AllocationStat();
+
+ bool get hasNoAllocations {
+ return accumulatedNewSpace.empty &&
+ accumulatedOldSpace.empty &&
+ currentNewSpace.empty &&
+ currentOldSpace.empty;
+ }
+
@reflectable final children = new ObservableList<Class>();
@reflectable final subClasses = new ObservableList<Class>();
@reflectable final fields = new ObservableList<ServiceMap>();

Powered by Google App Engine
This is Rietveld 408576698