| OLD | NEW |
| 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 part of service; | 5 part of service; |
| 6 | 6 |
| 7 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
| 8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
| 9 // object ring. | 9 // object ring. |
| 10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 snapshot.delta(counters, _maxSnapshot.counters); | 1070 snapshot.delta(counters, _maxSnapshot.counters); |
| 1071 _maxSnapshot.max(counters); | 1071 _maxSnapshot.max(counters); |
| 1072 snapshots.add(snapshot); | 1072 snapshots.add(snapshot); |
| 1073 // Only keep _historySize snapshots. | 1073 // Only keep _historySize snapshots. |
| 1074 if (snapshots.length > _historySize) { | 1074 if (snapshots.length > _historySize) { |
| 1075 snapshots.removeAt(0); | 1075 snapshots.removeAt(0); |
| 1076 } | 1076 } |
| 1077 } | 1077 } |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 class HeapSpace extends Observable { | 1080 class HeapSpace extends Observable implements M.HeapSpace { |
| 1081 @observable int used = 0; | 1081 @observable int used = 0; |
| 1082 @observable int capacity = 0; | 1082 @observable int capacity = 0; |
| 1083 @observable int external = 0; | 1083 @observable int external = 0; |
| 1084 @observable int collections = 0; | 1084 @observable int collections = 0; |
| 1085 @observable double totalCollectionTimeInSeconds = 0.0; | 1085 @observable double totalCollectionTimeInSeconds = 0.0; |
| 1086 @observable double averageCollectionPeriodInMillis = 0.0; | 1086 @observable double averageCollectionPeriodInMillis = 0.0; |
| 1087 | 1087 |
| 1088 void update(Map heapMap) { | 1088 void update(Map heapMap) { |
| 1089 used = heapMap['used']; | 1089 used = heapMap['used']; |
| 1090 capacity = heapMap['capacity']; | 1090 capacity = heapMap['capacity']; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 @observable int number; | 1132 @observable int number; |
| 1133 @observable int originNumber; | 1133 @observable int originNumber; |
| 1134 @observable DateTime startTime; | 1134 @observable DateTime startTime; |
| 1135 @observable Duration get upTime { | 1135 @observable Duration get upTime { |
| 1136 if (startTime == null) { | 1136 if (startTime == null) { |
| 1137 return null; | 1137 return null; |
| 1138 } | 1138 } |
| 1139 return (new DateTime.now().difference(startTime)); | 1139 return (new DateTime.now().difference(startTime)); |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 @observable ObservableMap counters = new ObservableMap(); | 1142 @observable Map counters = {}; |
| 1143 | 1143 |
| 1144 void _updateRunState() { | 1144 void _updateRunState() { |
| 1145 topFrame = (pauseEvent != null ? pauseEvent.topFrame : null); | 1145 topFrame = (pauseEvent != null ? pauseEvent.topFrame : null); |
| 1146 paused = (pauseEvent != null && | 1146 paused = (pauseEvent != null && |
| 1147 pauseEvent.kind != ServiceEvent.kResume); | 1147 pauseEvent.kind != ServiceEvent.kResume); |
| 1148 running = (!paused && topFrame != null); | 1148 running = (!paused && topFrame != null); |
| 1149 idle = (!paused && topFrame == null); | 1149 idle = (!paused && topFrame == null); |
| 1150 notifyPropertyChange(#topFrame, 0, 1); | 1150 notifyPropertyChange(#topFrame, 0, 1); |
| 1151 notifyPropertyChange(#paused, 0, 1); | 1151 notifyPropertyChange(#paused, 0, 1); |
| 1152 notifyPropertyChange(#running, 0, 1); | 1152 notifyPropertyChange(#running, 0, 1); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 notifyPropertyChange(#upTime, 0, 1); | 1434 notifyPropertyChange(#upTime, 0, 1); |
| 1435 var countersMap = map['_tagCounters']; | 1435 var countersMap = map['_tagCounters']; |
| 1436 if (countersMap != null) { | 1436 if (countersMap != null) { |
| 1437 var names = countersMap['names']; | 1437 var names = countersMap['names']; |
| 1438 var counts = countersMap['counters']; | 1438 var counts = countersMap['counters']; |
| 1439 assert(names.length == counts.length); | 1439 assert(names.length == counts.length); |
| 1440 var sum = 0; | 1440 var sum = 0; |
| 1441 for (var i = 0; i < counts.length; i++) { | 1441 for (var i = 0; i < counts.length; i++) { |
| 1442 sum += counts[i]; | 1442 sum += counts[i]; |
| 1443 } | 1443 } |
| 1444 // TODO: Why does this not work without this? | 1444 var _counters = {}; |
| 1445 counters = toObservable({}); | |
| 1446 if (sum == 0) { | 1445 if (sum == 0) { |
| 1447 for (var i = 0; i < names.length; i++) { | 1446 for (var i = 0; i < names.length; i++) { |
| 1448 counters[names[i]] = '0.0%'; | 1447 _counters[names[i]] = '0.0%'; |
| 1449 } | 1448 } |
| 1450 } else { | 1449 } else { |
| 1451 for (var i = 0; i < names.length; i++) { | 1450 for (var i = 0; i < names.length; i++) { |
| 1452 counters[names[i]] = | 1451 _counters[names[i]] = |
| 1453 (counts[i] / sum * 100.0).toStringAsFixed(2) + '%'; | 1452 (counts[i] / sum * 100.0).toStringAsFixed(2) + '%'; |
| 1454 } | 1453 } |
| 1455 } | 1454 } |
| 1455 counters = _counters; |
| 1456 } | 1456 } |
| 1457 | 1457 |
| 1458 updateHeapsFromMap(map['_heaps']); | 1458 updateHeapsFromMap(map['_heaps']); |
| 1459 _updateBreakpoints(map['breakpoints']); | 1459 _updateBreakpoints(map['breakpoints']); |
| 1460 if (map['_debuggerSettings'] != null) { | 1460 if (map['_debuggerSettings'] != null) { |
| 1461 exceptionsPauseInfo = map['_debuggerSettings']['_exceptions']; | 1461 exceptionsPauseInfo = map['_debuggerSettings']['_exceptions']; |
| 1462 } else { | 1462 } else { |
| 1463 exceptionsPauseInfo = "none"; | 1463 exceptionsPauseInfo = "none"; |
| 1464 } | 1464 } |
| 1465 | 1465 |
| (...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4094 var v = list[i]; | 4094 var v = list[i]; |
| 4095 if ((v is ObservableMap) && _isServiceMap(v)) { | 4095 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 4096 list[i] = owner.getFromMap(v); | 4096 list[i] = owner.getFromMap(v); |
| 4097 } else if (v is ObservableList) { | 4097 } else if (v is ObservableList) { |
| 4098 _upgradeObservableList(v, owner); | 4098 _upgradeObservableList(v, owner); |
| 4099 } else if (v is ObservableMap) { | 4099 } else if (v is ObservableMap) { |
| 4100 _upgradeObservableMap(v, owner); | 4100 _upgradeObservableMap(v, owner); |
| 4101 } | 4101 } |
| 4102 } | 4102 } |
| 4103 } | 4103 } |
| OLD | NEW |