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

Unified Diff: runtime/bin/main.cc

Issue 2996803002: Add current rss and embedder name to Observatory (Closed)
Patch Set: Refactoring Created 3 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
« no previous file with comments | « no previous file | runtime/bin/process_android.cc » ('j') | runtime/vm/service.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 9977e9bc9480134e689d4da964d8d0e88d81f32a..ad6d02ecac13dffdbb4357996ed7a5df031b7da8 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1356,6 +1356,16 @@ static bool FileModifiedCallback(const char* url, int64_t since) {
return modified;
}
+static void EmbedderInformationCallback(Dart_EmbedderInformation* info) {
+ int64_t max_rss = Process::MaxRSS();
+ int64_t current_rss = Process::CurrentRSS();
+
+ info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION;
+ info->name = "Dart VM";
+ info->max_rss = max_rss >= 0 ? max_rss : 0;
+ info->current_rss = current_rss >= 0 ? current_rss : 0;
+}
+
static void GenerateAppAOTSnapshot() {
if (use_blobs) {
Snapshot::GenerateAppAOTAsBlobs(snapshot_filename);
@@ -1805,6 +1815,7 @@ void main(int argc, char** argv) {
Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback,
&ServiceStreamCancelCallback);
Dart_SetFileModifiedCallback(&FileModifiedCallback);
+ Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback);
// Run the main isolate until we aren't told to restart.
while (RunMainIsolate(script_name, &dart_options)) {
« no previous file with comments | « no previous file | runtime/bin/process_android.cc » ('j') | runtime/vm/service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698