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 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 String fileAndLine; | 1500 String fileAndLine; |
1501 | 1501 |
1502 DartError error; | 1502 DartError error; |
1503 StreamController _snapshotFetch; | 1503 StreamController _snapshotFetch; |
1504 | 1504 |
1505 List<ByteData> _chunksInProgress; | 1505 List<ByteData> _chunksInProgress; |
1506 | 1506 |
1507 List<Thread> get threads => _threads; | 1507 List<Thread> get threads => _threads; |
1508 final List<Thread> _threads = new List<Thread>(); | 1508 final List<Thread> _threads = new List<Thread>(); |
1509 | 1509 |
1510 int get memoryHighWatermark => _memoryHighWatermark; | |
1511 int _memoryHighWatermark; | |
1512 | |
1513 void _loadHeapSnapshot(ServiceEvent event) { | 1510 void _loadHeapSnapshot(ServiceEvent event) { |
1514 if (_snapshotFetch == null || _snapshotFetch.isClosed) { | 1511 if (_snapshotFetch == null || _snapshotFetch.isClosed) { |
1515 // No outstanding snapshot request. Presumably another client asked for a | 1512 // No outstanding snapshot request. Presumably another client asked for a |
1516 // snapshot. | 1513 // snapshot. |
1517 Logger.root.info("Dropping unsolicited heap snapshot chunk"); | 1514 Logger.root.info("Dropping unsolicited heap snapshot chunk"); |
1518 return; | 1515 return; |
1519 } | 1516 } |
1520 | 1517 |
1521 // Occasionally these actually arrive out of order. | 1518 // Occasionally these actually arrive out of order. |
1522 var chunkIndex = event.chunkIndex; | 1519 var chunkIndex = event.chunkIndex; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 | 1628 |
1632 extensionRPCs.clear(); | 1629 extensionRPCs.clear(); |
1633 if (map['extensionRPCs'] != null) { | 1630 if (map['extensionRPCs'] != null) { |
1634 extensionRPCs.addAll(map['extensionRPCs']); | 1631 extensionRPCs.addAll(map['extensionRPCs']); |
1635 } | 1632 } |
1636 | 1633 |
1637 threads.clear(); | 1634 threads.clear(); |
1638 if(map['threads'] != null) { | 1635 if(map['threads'] != null) { |
1639 threads.addAll(map['threads']); | 1636 threads.addAll(map['threads']); |
1640 } | 1637 } |
1641 | |
1642 _memoryHighWatermark = map['isolateMemoryHighWatermark']; | |
1643 } | 1638 } |
1644 | 1639 |
1645 Future<TagProfile> updateTagProfile() { | 1640 Future<TagProfile> updateTagProfile() { |
1646 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then((Map map) { | 1641 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then((Map map) { |
1647 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; | 1642 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; |
1648 tagProfile._processTagProfile(seconds, map); | 1643 tagProfile._processTagProfile(seconds, map); |
1649 return tagProfile; | 1644 return tagProfile; |
1650 }); | 1645 }); |
1651 } | 1646 } |
1652 | 1647 |
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3070 | 3065 |
3071 String toString() => 'Sentinel($kind)'; | 3066 String toString() => 'Sentinel($kind)'; |
3072 String get shortName => valueAsString; | 3067 String get shortName => valueAsString; |
3073 } | 3068 } |
3074 | 3069 |
3075 class Thread extends ServiceObject implements M.Thread { | 3070 class Thread extends ServiceObject implements M.Thread { |
3076 M.ThreadKind get kind => _kind; | 3071 M.ThreadKind get kind => _kind; |
3077 M.ThreadKind _kind; | 3072 M.ThreadKind _kind; |
3078 String get kindString => _kindString; | 3073 String get kindString => _kindString; |
3079 String _kindString; | 3074 String _kindString; |
3080 int get memoryHighWatermark => _memoryHighWatermark; | |
3081 int _memoryHighWatermark; | |
3082 List<Zone> get zones => _zones; | 3075 List<Zone> get zones => _zones; |
3083 final List<Zone> _zones = new List<Zone>(); | 3076 final List<Zone> _zones = new List<Zone>(); |
3084 | 3077 |
3085 Thread._empty(ServiceObjectOwner owner) : super._empty(owner); | 3078 Thread._empty(ServiceObjectOwner owner) : super._empty(owner); |
3086 | 3079 |
3087 void _update(Map map, bool mapIsRef) { | 3080 void _update(Map map, bool mapIsRef) { |
3088 String rawKind = map['kind']; | 3081 String rawKind = map['kind']; |
3089 List<Map> zoneList = map['zones']; | 3082 List<Map> zoneList = map['zones']; |
3090 | 3083 |
3091 switch(rawKind) { | 3084 switch(rawKind) { |
(...skipping 17 matching lines...) Expand all Loading... |
3109 _kind = M.ThreadKind.markerTask; | 3102 _kind = M.ThreadKind.markerTask; |
3110 _kindString = 'marker'; | 3103 _kindString = 'marker'; |
3111 break; | 3104 break; |
3112 case "kFinalizerTask": | 3105 case "kFinalizerTask": |
3113 _kind = M.ThreadKind.finalizerTask; | 3106 _kind = M.ThreadKind.finalizerTask; |
3114 _kindString = 'finalizer'; | 3107 _kindString = 'finalizer'; |
3115 break; | 3108 break; |
3116 default: | 3109 default: |
3117 assert(false); | 3110 assert(false); |
3118 } | 3111 } |
3119 | |
3120 _memoryHighWatermark = map['threadMemoryHighWatermark']; | |
3121 | |
3122 zones.clear(); | 3112 zones.clear(); |
3123 zoneList.forEach((zone) { | 3113 zoneList.forEach((zone) { |
3124 int capacity = zone['capacity']; | 3114 int capacity = zone['capacity']; |
3125 int used = zone['used']; | 3115 int used = zone['used']; |
3126 zones.add(new Zone(capacity, used)); | 3116 zones.add(new Zone(capacity, used)); |
3127 }); | 3117 }); |
3128 } | 3118 } |
3129 } | 3119 } |
3130 | 3120 |
3131 class Zone implements M.Zone { | 3121 class Zone implements M.Zone { |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4501 var v = list[i]; | 4491 var v = list[i]; |
4502 if ((v is Map) && _isServiceMap(v)) { | 4492 if ((v is Map) && _isServiceMap(v)) { |
4503 list[i] = owner.getFromMap(v); | 4493 list[i] = owner.getFromMap(v); |
4504 } else if (v is List) { | 4494 } else if (v is List) { |
4505 _upgradeList(v, owner); | 4495 _upgradeList(v, owner); |
4506 } else if (v is Map) { | 4496 } else if (v is Map) { |
4507 _upgradeMap(v, owner); | 4497 _upgradeMap(v, owner); |
4508 } | 4498 } |
4509 } | 4499 } |
4510 } | 4500 } |
OLD | NEW |