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

Unified Diff: runtime/vm/pages.cc

Issue 353003005: Display average time between collections (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/bin/vmservice/client/lib/src/service/object.dart ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index e623cd78c334a2b36196091e62b556dbe176689c..b8be8250f31ef71f9e2b7e42afe4c1264ee8c660 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -373,6 +373,8 @@ void PageSpace::WriteProtect(bool read_only) {
void PageSpace::PrintToJSONObject(JSONObject* object) {
+ Isolate* isolate = Isolate::Current();
+ ASSERT(isolate != NULL);
JSONObject space(object, "old");
space.AddProperty("type", "PageSpace");
space.AddProperty("id", "heaps/old");
@@ -383,6 +385,15 @@ void PageSpace::PrintToJSONObject(JSONObject* object) {
space.AddProperty("capacity", CapacityInWords() * kWordSize);
space.AddProperty("external", ExternalInWords() * kWordSize);
space.AddProperty("time", MicrosecondsToSeconds(gc_time_micros()));
+ {
+ int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time();
koda 2014/06/26 19:42:38 Note to self: yet another reason to consider a Spa
+ run_time = Utils::Maximum(run_time, static_cast<int64_t>(0));
+ double run_time_millis = MicrosecondsToMilliseconds(run_time);
+ double avg_time_between_collections =
+ run_time_millis / static_cast<double>(collections());
+ space.AddProperty("avgCollectionPeriodMillis",
+ avg_time_between_collections);
+ }
}
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/service/object.dart ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698