| 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 #ifndef VM_METRICS_H_ | 5 #ifndef VM_METRICS_H_ |
| 6 #define VM_METRICS_H_ | 6 #define VM_METRICS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 class Isolate; | 12 class Isolate; |
| 13 class JSONStream; | 13 class JSONStream; |
| 14 | 14 |
| 15 // Metrics for each isolate. | 15 // Metrics for each isolate. |
| 16 #define ISOLATE_METRIC_LIST(V) \ | 16 #define ISOLATE_METRIC_LIST(V) \ |
| 17 V(MetricHeapOldUsed, HeapOldUsed, "heap.old.used", kByte) \ | 17 V(MetricHeapOldUsed, HeapOldUsed, "heap.old.used", kByte) \ |
| 18 V(MetricHeapOldCapacity, HeapOldCapacity, "heap.old.capacity", kByte) \ | 18 V(MetricHeapOldCapacity, HeapOldCapacity, "heap.old.capacity", kByte) \ |
| 19 V(MaxMetric, HeapOldCapacityMax, "heap.old.capacity.max", kByte) \ |
| 19 V(MetricHeapOldExternal, HeapOldExternal, "heap.old.external", kByte) \ | 20 V(MetricHeapOldExternal, HeapOldExternal, "heap.old.external", kByte) \ |
| 20 V(MetricHeapNewUsed, HeapNewUsed, "heap.new.used", kByte) \ | 21 V(MetricHeapNewUsed, HeapNewUsed, "heap.new.used", kByte) \ |
| 21 V(MetricHeapNewCapacity, HeapNewCapacity, "heap.new.capacity", kByte) \ | 22 V(MetricHeapNewCapacity, HeapNewCapacity, "heap.new.capacity", kByte) \ |
| 22 V(MetricHeapNewExternal, HeapNewExternal, "heap.new.external", kByte) \ | 23 V(MaxMetric, HeapNewCapacityMax, "heap.new.capacity.max", kByte) \ |
| 24 V(MetricHeapNewExternal, HeapNewExternal, "heap.new.external", kByte) |
| 23 | 25 |
| 24 #define VM_METRIC_LIST(V) \ | 26 #define VM_METRIC_LIST(V) \ |
| 25 V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter) \ | 27 V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter) |
| 26 | 28 |
| 27 class Metric { | 29 class Metric { |
| 28 public: | 30 public: |
| 29 enum Unit { | 31 enum Unit { |
| 30 kCounter, | 32 kCounter, |
| 31 kByte, | 33 kByte, |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 Metric(); | 36 Metric(); |
| 35 | 37 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void RegisterWithIsolate(); | 97 void RegisterWithIsolate(); |
| 96 void DeregisterWithIsolate(); | 98 void DeregisterWithIsolate(); |
| 97 void RegisterWithVM(); | 99 void RegisterWithVM(); |
| 98 void DeregisterWithVM(); | 100 void DeregisterWithVM(); |
| 99 | 101 |
| 100 static Metric* vm_list_head_; | 102 static Metric* vm_list_head_; |
| 101 DISALLOW_COPY_AND_ASSIGN(Metric); | 103 DISALLOW_COPY_AND_ASSIGN(Metric); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 | 106 |
| 107 // A Metric class that reports the maximum value observed. |
| 108 // Initial maximum is kMinInt64. |
| 109 class MaxMetric : public Metric { |
| 110 public: |
| 111 MaxMetric(); |
| 112 |
| 113 void SetValue(int64_t new_value); |
| 114 }; |
| 115 |
| 116 |
| 117 // A Metric class that reports the minimum value observed. |
| 118 // Initial minimum is kMaxInt64. |
| 119 class MinMetric : public Metric { |
| 120 public: |
| 121 MinMetric(); |
| 122 |
| 123 void SetValue(int64_t new_value); |
| 124 }; |
| 125 |
| 126 |
| 105 class MetricHeapOldUsed : public Metric { | 127 class MetricHeapOldUsed : public Metric { |
| 106 protected: | 128 protected: |
| 107 virtual int64_t Value() const; | 129 virtual int64_t Value() const; |
| 108 }; | 130 }; |
| 109 | 131 |
| 110 | 132 |
| 111 class MetricHeapOldCapacity : public Metric { | 133 class MetricHeapOldCapacity : public Metric { |
| 112 protected: | 134 protected: |
| 113 virtual int64_t Value() const; | 135 virtual int64_t Value() const; |
| 114 }; | 136 }; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 140 | 162 |
| 141 class MetricIsolateCount : public Metric { | 163 class MetricIsolateCount : public Metric { |
| 142 protected: | 164 protected: |
| 143 virtual int64_t Value() const; | 165 virtual int64_t Value() const; |
| 144 }; | 166 }; |
| 145 | 167 |
| 146 | 168 |
| 147 } // namespace dart | 169 } // namespace dart |
| 148 | 170 |
| 149 #endif // VM_METRICS_H_ | 171 #endif // VM_METRICS_H_ |
| OLD | NEW |