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

Unified Diff: runtime/bin/vmstats.h

Issue 12221022: Initial prototype of vmstats support, based on Dart VM Stats draft design doc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/bin/vmstats.h
===================================================================
--- runtime/bin/vmstats.h (revision 0)
+++ runtime/bin/vmstats.h (revision 0)
@@ -0,0 +1,51 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
siva 2013/02/09 01:00:57 2013
Tom Ball 2013/02/14 23:45:16 Done.
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef BIN_VMSTATS_H_
+#define BIN_VMSTATS_H_
+
+#include <map>
+#include <sstream>
+#include <string>
+
+#include "bin/isolate_data.h"
+#include "include/dart_debugger_api.h"
+
+namespace dart {
+
+// VmStats is a HTTP singleton service that reports status information
+// of the running VM.
+
+class VmStats {
+ public:
+ static void Start(int port);
+ static void Stop();
+
+ // Add and remove functions for the isolate_table, called by main.cc.
+ static void AddIsolate(IsolateData* isolate_data, Dart_Isolate isolate);
+ static void RemoveIsolate(IsolateData* isolate_data);
+
+ private:
+ VmStats() {}
+
+ // Initial server thread function.
+ static void WebServer(uword server_socket);
+
+ // Status text generators.
+ void MemoryUsed(std::ostringstream* stream);
+
+ typedef std::map<IsolateData*, Dart_Isolate> IsolateTable;
+
+ std::string root_directory_;
+ IsolateTable isolate_table_;
+
+ static VmStats* instance_;
+
+ // Disallow copy constructor.
+ DISALLOW_COPY_AND_ASSIGN(VmStats);
+};
+
+} // namespace dart
+
+#endif // BIN_VMSTATS_H_

Powered by Google App Engine
This is Rietveld 408576698