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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // 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.
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef BIN_VMSTATS_H_
6 #define BIN_VMSTATS_H_
7
8 #include <map>
9 #include <sstream>
10 #include <string>
11
12 #include "bin/isolate_data.h"
13 #include "include/dart_debugger_api.h"
14
15 namespace dart {
16
17 // VmStats is a HTTP singleton service that reports status information
18 // of the running VM.
19
20 class VmStats {
21 public:
22 static void Start(int port);
23 static void Stop();
24
25 // Add and remove functions for the isolate_table, called by main.cc.
26 static void AddIsolate(IsolateData* isolate_data, Dart_Isolate isolate);
27 static void RemoveIsolate(IsolateData* isolate_data);
28
29 private:
30 VmStats() {}
31
32 // Initial server thread function.
33 static void WebServer(uword server_socket);
34
35 // Status text generators.
36 void MemoryUsed(std::ostringstream* stream);
37
38 typedef std::map<IsolateData*, Dart_Isolate> IsolateTable;
39
40 std::string root_directory_;
41 IsolateTable isolate_table_;
42
43 static VmStats* instance_;
44
45 // Disallow copy constructor.
46 DISALLOW_COPY_AND_ASSIGN(VmStats);
47 };
48
49 } // namespace dart
50
51 #endif // BIN_VMSTATS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698