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

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

Issue 1660063002: Remove many features when building product mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/message.cc ('k') | runtime/vm/metrics_test.cc » ('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 #include "vm/metrics.h" 5 #include "vm/metrics.h"
6 6
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/json_stream.h" 8 #include "vm/json_stream.h"
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 case Metric::kByte: return "byte"; 73 case Metric::kByte: return "byte";
74 default: 74 default:
75 UNREACHABLE(); 75 UNREACHABLE();
76 } 76 }
77 UNREACHABLE(); 77 UNREACHABLE();
78 return NULL; 78 return NULL;
79 } 79 }
80 80
81 81
82 void Metric::PrintJSON(JSONStream* stream) { 82 void Metric::PrintJSON(JSONStream* stream) {
83 if (!FLAG_support_service) {
84 return;
85 }
83 JSONObject obj(stream); 86 JSONObject obj(stream);
84 obj.AddProperty("type", "Counter"); 87 obj.AddProperty("type", "Counter");
85 obj.AddProperty("name", name_); 88 obj.AddProperty("name", name_);
86 obj.AddProperty("description", description_); 89 obj.AddProperty("description", description_);
87 obj.AddProperty("unit", UnitString(unit())); 90 obj.AddProperty("unit", UnitString(unit()));
88 if (isolate_ == NULL) { 91 if (isolate_ == NULL) {
89 obj.AddFixedServiceId("vm/metrics/%s", name_); 92 obj.AddFixedServiceId("vm/metrics/%s", name_);
90 } else { 93 } else {
91 obj.AddFixedServiceId("metrics/native/%s", name_); 94 obj.AddFixedServiceId("metrics/native/%s", name_);
92 } 95 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 336 }
334 337
335 338
336 void MinMetric::SetValue(int64_t new_value) { 339 void MinMetric::SetValue(int64_t new_value) {
337 if (new_value < value()) { 340 if (new_value < value()) {
338 set_value(new_value); 341 set_value(new_value);
339 } 342 }
340 } 343 }
341 344
342 } // namespace dart 345 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/message.cc ('k') | runtime/vm/metrics_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698