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 RUNTIME_VM_METRICS_H_ | 5 #ifndef RUNTIME_VM_METRICS_H_ |
6 #define RUNTIME_VM_METRICS_H_ | 6 #define RUNTIME_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(MaxMetric, HeapOldUsedMax, "heap.old.used.max", kByte) \ | 18 V(MaxMetric, HeapOldUsedMax, "heap.old.used.max", kByte) \ |
19 V(MetricHeapOldCapacity, HeapOldCapacity, "heap.old.capacity", kByte) \ | 19 V(MetricHeapOldCapacity, HeapOldCapacity, "heap.old.capacity", kByte) \ |
20 V(MaxMetric, HeapOldCapacityMax, "heap.old.capacity.max", kByte) \ | 20 V(MaxMetric, HeapOldCapacityMax, "heap.old.capacity.max", kByte) \ |
21 V(MetricHeapOldExternal, HeapOldExternal, "heap.old.external", kByte) \ | 21 V(MetricHeapOldExternal, HeapOldExternal, "heap.old.external", kByte) \ |
22 V(MetricHeapNewUsed, HeapNewUsed, "heap.new.used", kByte) \ | 22 V(MetricHeapNewUsed, HeapNewUsed, "heap.new.used", kByte) \ |
23 V(MaxMetric, HeapNewUsedMax, "heap.new.used.max", kByte) \ | 23 V(MaxMetric, HeapNewUsedMax, "heap.new.used.max", kByte) \ |
24 V(MetricHeapNewCapacity, HeapNewCapacity, "heap.new.capacity", kByte) \ | 24 V(MetricHeapNewCapacity, HeapNewCapacity, "heap.new.capacity", kByte) \ |
25 V(MaxMetric, HeapNewCapacityMax, "heap.new.capacity.max", kByte) \ | 25 V(MaxMetric, HeapNewCapacityMax, "heap.new.capacity.max", kByte) \ |
26 V(MetricHeapNewExternal, HeapNewExternal, "heap.new.external", kByte) \ | 26 V(MetricHeapNewExternal, HeapNewExternal, "heap.new.external", kByte) \ |
27 V(MetricHeapUsed, HeapGlobalUsed, "heap.global.used", kByte) \ | 27 V(MetricHeapUsed, HeapGlobalUsed, "heap.global.used", kByte) \ |
28 V(MaxMetric, HeapGlobalUsedMax, "heap.global.used.max", kByte) | 28 V(MaxMetric, HeapGlobalUsedMax, "heap.global.used.max", kByte) \ |
| 29 V(Metric, RunnableLatency, "isolate.runnable.latency", kMicrosecond) \ |
| 30 V(Metric, RunnableHeapSize, "isolate.runnable.heap", kByte) |
29 | 31 |
30 #define VM_METRIC_LIST(V) \ | 32 #define VM_METRIC_LIST(V) \ |
31 V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter) | 33 V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter) \ |
| 34 V(MetricPeakRSS, PeakRSS, "vm.memory.max", kByte) |
32 | 35 |
33 class Metric { | 36 class Metric { |
34 public: | 37 public: |
35 enum Unit { | 38 enum Unit { |
36 kCounter, | 39 kCounter, |
37 kByte, | 40 kByte, |
| 41 kMicrosecond, |
38 }; | 42 }; |
39 | 43 |
40 Metric(); | 44 Metric(); |
41 | 45 |
42 static void InitOnce(); | 46 static void InitOnce(); |
43 | 47 |
44 static void Cleanup(); | 48 static void Cleanup(); |
45 | 49 |
46 // Initialize and register a metric for an isolate. | 50 // Initialize and register a metric for an isolate. |
47 void Init(Isolate* isolate, | 51 void Init(Isolate* isolate, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 virtual int64_t Value() const; | 165 virtual int64_t Value() const; |
162 }; | 166 }; |
163 | 167 |
164 | 168 |
165 class MetricIsolateCount : public Metric { | 169 class MetricIsolateCount : public Metric { |
166 protected: | 170 protected: |
167 virtual int64_t Value() const; | 171 virtual int64_t Value() const; |
168 }; | 172 }; |
169 | 173 |
170 | 174 |
| 175 class MetricPeakRSS : public Metric { |
| 176 protected: |
| 177 virtual int64_t Value() const; |
| 178 }; |
| 179 |
| 180 |
171 class MetricHeapUsed : public Metric { | 181 class MetricHeapUsed : public Metric { |
172 protected: | 182 protected: |
173 virtual int64_t Value() const; | 183 virtual int64_t Value() const; |
174 }; | 184 }; |
175 | 185 |
176 } // namespace dart | 186 } // namespace dart |
177 | 187 |
178 #endif // RUNTIME_VM_METRICS_H_ | 188 #endif // RUNTIME_VM_METRICS_H_ |
OLD | NEW |