| 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 #if !defined(PRODUCT) | 5 #if !defined(PRODUCT) |
| 6 | 6 |
| 7 #include "vm/metrics.h" | 7 #include "vm/metrics.h" |
| 8 | 8 |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/json_stream.h" | 10 #include "vm/json_stream.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 int64_t MetricHeapUsed::Value() const { | 282 int64_t MetricHeapUsed::Value() const { |
| 283 ASSERT(isolate() == Isolate::Current()); | 283 ASSERT(isolate() == Isolate::Current()); |
| 284 return isolate()->heap()->UsedInWords(Heap::kNew) * kWordSize + | 284 return isolate()->heap()->UsedInWords(Heap::kNew) * kWordSize + |
| 285 isolate()->heap()->UsedInWords(Heap::kOld) * kWordSize; | 285 isolate()->heap()->UsedInWords(Heap::kOld) * kWordSize; |
| 286 } | 286 } |
| 287 | 287 |
| 288 int64_t MetricIsolateCount::Value() const { | 288 int64_t MetricIsolateCount::Value() const { |
| 289 return Isolate::IsolateListLength(); | 289 return Isolate::IsolateListLength(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 int64_t MetricCurrentRSS::Value() const { | |
| 293 return Service::CurrentRSS(); | |
| 294 } | |
| 295 | |
| 296 int64_t MetricPeakRSS::Value() const { | 292 int64_t MetricPeakRSS::Value() const { |
| 297 return Service::MaxRSS(); | 293 return OS::MaxRSS(); |
| 298 } | 294 } |
| 299 | 295 |
| 300 #define VM_METRIC_VARIABLE(type, variable, name, unit) \ | 296 #define VM_METRIC_VARIABLE(type, variable, name, unit) \ |
| 301 static type vm_metric_##variable##_; | 297 static type vm_metric_##variable##_; |
| 302 VM_METRIC_LIST(VM_METRIC_VARIABLE); | 298 VM_METRIC_LIST(VM_METRIC_VARIABLE); |
| 303 #undef VM_METRIC_VARIABLE | 299 #undef VM_METRIC_VARIABLE |
| 304 | 300 |
| 305 void Metric::InitOnce() { | 301 void Metric::InitOnce() { |
| 306 #define VM_METRIC_INIT(type, variable, name, unit) \ | 302 #define VM_METRIC_INIT(type, variable, name, unit) \ |
| 307 vm_metric_##variable##_.Init(name, NULL, Metric::unit); | 303 vm_metric_##variable##_.Init(name, NULL, Metric::unit); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 335 |
| 340 void MinMetric::SetValue(int64_t new_value) { | 336 void MinMetric::SetValue(int64_t new_value) { |
| 341 if (new_value < value()) { | 337 if (new_value < value()) { |
| 342 set_value(new_value); | 338 set_value(new_value); |
| 343 } | 339 } |
| 344 } | 340 } |
| 345 | 341 |
| 346 } // namespace dart | 342 } // namespace dart |
| 347 | 343 |
| 348 #endif // !defined(PRODUCT) | 344 #endif // !defined(PRODUCT) |
| OLD | NEW |