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 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const char* description, | 49 const char* description, |
50 Unit unit); | 50 Unit unit); |
51 | 51 |
52 // Initialize and register a metric for the VM. | 52 // Initialize and register a metric for the VM. |
53 void Init(const char* name, | 53 void Init(const char* name, |
54 const char* description, | 54 const char* description, |
55 Unit unit); | 55 Unit unit); |
56 | 56 |
57 virtual ~Metric(); | 57 virtual ~Metric(); |
58 | 58 |
| 59 #ifndef PRODUCT |
59 void PrintJSON(JSONStream* stream); | 60 void PrintJSON(JSONStream* stream); |
| 61 #endif // !PRODUCT |
60 | 62 |
61 // Returns a zone allocated string. | 63 // Returns a zone allocated string. |
62 static char* ValueToString(int64_t value, Unit unit); | 64 static char* ValueToString(int64_t value, Unit unit); |
63 | 65 |
64 // Returns a zone allocated string. | 66 // Returns a zone allocated string. |
65 char* ToString(); | 67 char* ToString(); |
66 | 68 |
67 int64_t value() const { return value_; } | 69 int64_t value() const { return value_; } |
68 void set_value(int64_t value) { value_ = value; } | 70 void set_value(int64_t value) { value_ = value; } |
69 | 71 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 173 |
172 | 174 |
173 class MetricHeapUsed : public Metric { | 175 class MetricHeapUsed : public Metric { |
174 protected: | 176 protected: |
175 virtual int64_t Value() const; | 177 virtual int64_t Value() const; |
176 }; | 178 }; |
177 | 179 |
178 } // namespace dart | 180 } // namespace dart |
179 | 181 |
180 #endif // VM_METRICS_H_ | 182 #endif // VM_METRICS_H_ |
OLD | NEW |