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

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: Better sorting tests 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 fabc340c386f945811bf77dc033e5b073f57d895..4dcc7de59fd49b1971034d67e5ed8ae0779b0d04 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -1089,6 +1089,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'];
@@ -2226,7 +2243,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;
@@ -2238,7 +2255,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;
« no previous file with comments | « runtime/observatory/lib/src/repositories/allocation_profile.dart ('k') | runtime/observatory/lib/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698