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

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 2255613002: Converted Observatory heap-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Avoid to send dateLastServiceGC & dateLastAccumulatorReset if never happened Created 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 525b1b7d1402b7e3ef217b6bb521bf87f984b884..f48afc60091a85d447505843737909efa9f2ace4 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -1085,6 +1085,23 @@ class HeapSpace extends Observable implements M.HeapSpace {
@observable double totalCollectionTimeInSeconds = 0.0;
@observable double averageCollectionPeriodInMillis = 0.0;
+ Duration get avgCollectionTime {
+ final mcs = totalCollectionTimeInSeconds * Duration.MICROSECONDS_PER_SECOND
+ / math.max(collections, 1);
+ return new Duration(microseconds: mcs.ceil());
+ }
+
+ Duration get totalCollectionTime {
+ final mcs = totalCollectionTimeInSeconds * Duration.MICROSECONDS_PER_SECOND;
+ return new Duration(microseconds: mcs.ceil());
+ }
+
+ Duration get avgCollectionPeriod {
+ final mcs = averageCollectionPeriodInMillis
+ * Duration.MICROSECONDS_PER_MILLISECOND;
+ return new Duration(microseconds: mcs.ceil());
+ }
+
void update(Map heapMap) {
used = heapMap['used'];
capacity = heapMap['capacity'];
@@ -2216,7 +2233,7 @@ class Library extends HeapObject implements M.LibraryRef {
String toString() => "Library($uri)";
}
-class AllocationCount extends Observable {
+class AllocationCount extends Observable implements M.AllocationCount {
@observable int instances = 0;
@observable int bytes = 0;
@@ -2228,7 +2245,7 @@ class AllocationCount extends Observable {
bool get empty => (instances == 0) && (bytes == 0);
}
-class Allocations {
+class Allocations implements M.Allocations{
// Indexes into VM provided array. (see vm/class_table.h).
static const ALLOCATED_BEFORE_GC = 0;
static const ALLOCATED_BEFORE_GC_SIZE = 1;

Powered by Google App Engine
This is Rietveld 408576698