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

Unified Diff: runtime/vm/metrics.cc

Issue 1391473002: Add Metrics for heap high water marks (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/metrics.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/metrics.cc
diff --git a/runtime/vm/metrics.cc b/runtime/vm/metrics.cc
index 79038fb1f266f2588919773c14920df0d8401fc1..274a3fd179f5025f1a90f1adf032497eae0ee788 100644
--- a/runtime/vm/metrics.cc
+++ b/runtime/vm/metrics.cc
@@ -307,4 +307,30 @@ void Metric::Cleanup() {
}
}
+
+MaxMetric::MaxMetric()
+ : Metric() {
+ set_value(kMinInt64);
+}
+
+
+void MaxMetric::SetValue(int64_t new_value) {
+ if (new_value > value()) {
+ set_value(new_value);
+ }
+}
+
+
+MinMetric::MinMetric()
+ : Metric() {
+ set_value(kMaxInt64);
+}
+
+
+void MinMetric::SetValue(int64_t new_value) {
+ if (new_value < value()) {
+ set_value(new_value);
+ }
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/metrics.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698