Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: runtime/vm/metrics.cc

Issue 2996803002: Add current rss and embedder name to Observatory (Closed)
Patch Set: Rebase and Merge Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/metrics.h ('k') | runtime/vm/os.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
292 int64_t MetricPeakRSS::Value() const { 296 int64_t MetricPeakRSS::Value() const {
293 return OS::MaxRSS(); 297 return Service::MaxRSS();
294 } 298 }
295 299
296 #define VM_METRIC_VARIABLE(type, variable, name, unit) \ 300 #define VM_METRIC_VARIABLE(type, variable, name, unit) \
297 static type vm_metric_##variable##_; 301 static type vm_metric_##variable##_;
298 VM_METRIC_LIST(VM_METRIC_VARIABLE); 302 VM_METRIC_LIST(VM_METRIC_VARIABLE);
299 #undef VM_METRIC_VARIABLE 303 #undef VM_METRIC_VARIABLE
300 304
301 void Metric::InitOnce() { 305 void Metric::InitOnce() {
302 #define VM_METRIC_INIT(type, variable, name, unit) \ 306 #define VM_METRIC_INIT(type, variable, name, unit) \
303 vm_metric_##variable##_.Init(name, NULL, Metric::unit); 307 vm_metric_##variable##_.Init(name, NULL, Metric::unit);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 339
336 void MinMetric::SetValue(int64_t new_value) { 340 void MinMetric::SetValue(int64_t new_value) {
337 if (new_value < value()) { 341 if (new_value < value()) {
338 set_value(new_value); 342 set_value(new_value);
339 } 343 }
340 } 344 }
341 345
342 } // namespace dart 346 } // namespace dart
343 347
344 #endif // !defined(PRODUCT) 348 #endif // !defined(PRODUCT)
OLDNEW
« no previous file with comments | « runtime/vm/metrics.h ('k') | runtime/vm/os.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698