| 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) |
| 32 | 34 |
| 33 class Metric { | 35 class Metric { |
| 34 public: | 36 public: |
| 35 enum Unit { | 37 enum Unit { |
| 36 kCounter, | 38 kCounter, |
| 37 kByte, | 39 kByte, |
| 40 kMicrosecond, |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 Metric(); | 43 Metric(); |
| 41 | 44 |
| 42 static void InitOnce(); | 45 static void InitOnce(); |
| 43 | 46 |
| 44 static void Cleanup(); | 47 static void Cleanup(); |
| 45 | 48 |
| 46 // Initialize and register a metric for an isolate. | 49 // Initialize and register a metric for an isolate. |
| 47 void Init(Isolate* isolate, | 50 void Init(Isolate* isolate, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 172 |
| 170 | 173 |
| 171 class MetricHeapUsed : public Metric { | 174 class MetricHeapUsed : public Metric { |
| 172 protected: | 175 protected: |
| 173 virtual int64_t Value() const; | 176 virtual int64_t Value() const; |
| 174 }; | 177 }; |
| 175 | 178 |
| 176 } // namespace dart | 179 } // namespace dart |
| 177 | 180 |
| 178 #endif // RUNTIME_VM_METRICS_H_ | 181 #endif // RUNTIME_VM_METRICS_H_ |
| OLD | NEW |