Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index c2a4e54bc728367b565d51b2c1af48325af81cc1..75123ba20489bb95518cabc5ed2c530b754b89e8 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -1168,6 +1168,16 @@ bool Isolate::MakeRunnable() { |
Service::HandleEvent(&runnableEvent); |
} |
#endif // !PRODUCT |
+ GetRunnableLatencyMetric()->set_value(UptimeMicros()); |
+ if (FLAG_print_benchmarking_metrics) { |
+ { |
+ StartIsolateScope scope(this); |
+ heap()->CollectAllGarbage(); |
+ } |
+ int64_t heap_size = (heap()->UsedInWords(Heap::kNew) * kWordSize) + |
+ (heap()->UsedInWords(Heap::kOld) * kWordSize); |
+ GetRunnableHeapSizeMetric()->set_value(heap_size); |
+ } |
return true; |
} |
@@ -1665,13 +1675,12 @@ void Isolate::LowLevelShutdown() { |
"\tisolate: %s\n", |
name()); |
} |
- if (FLAG_print_metrics) { |
+ if (FLAG_print_metrics || FLAG_print_benchmarking_metrics) { |
LogBlock lb; |
OS::PrintErr("Printing metrics for %s\n", name()); |
#define ISOLATE_METRIC_PRINT(type, variable, name, unit) \ |
OS::PrintErr("%s\n", metric_##variable##_.ToString()); |
- |
- ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT); |
+ ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT) |
#undef ISOLATE_METRIC_PRINT |
OS::PrintErr("\n"); |
} |