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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory/application.dart

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
Index: runtime/bin/vmservice/client/lib/src/observatory/application.dart
diff --git a/runtime/bin/vmservice/client/lib/src/observatory/application.dart b/runtime/bin/vmservice/client/lib/src/observatory/application.dart
index 46ea6315bf0f5f0b3497bb47681a278f8a1e7555..425e76f0e77f700c9f20bdf9cd053f1f7c8a2e80 100644
--- a/runtime/bin/vmservice/client/lib/src/observatory/application.dart
+++ b/runtime/bin/vmservice/client/lib/src/observatory/application.dart
@@ -46,4 +46,22 @@ class ObservatoryApplication extends Observable {
}
return isolate.name;
}
+
+ static const int KB = 1024;
+ static const int MB = KB * 1024;
+ static String scaledSizeUnits(int x) {
+ if (x > 2 * MB) {
+ var y = x / MB;
+ return '${y.toStringAsFixed(1)} MB';
+ } else if (x > 2 * KB) {
+ var y = x / KB;
+ return '${y.toStringAsFixed(1)} KB';
+ }
+ var y = x.toDouble();
+ return '${y.toStringAsFixed(1)} B';
+ }
+
+ static String timeUnits(double x) {
+ return x.toStringAsFixed(4);
+ }
}
« no previous file with comments | « no previous file | runtime/bin/vmservice/client/lib/src/observatory/request_manager.dart » ('j') | runtime/vm/class_table.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698