diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-01-26 11:21:16 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-01-26 11:21:16 -0500 |
commit | 6001665cee7d1dfd04d97058691c9d72ac190150 (patch) | |
tree | 6588fae2d089c2d2c30e6214ed8e99b8f0092c52 | |
parent | 60034218a71b89069750e693d53fe35676f3c775 (diff) | |
download | mongo-6001665cee7d1dfd04d97058691c9d72ac190150.tar.gz |
cleaning ProcessInfo usage so don't need in client
-rw-r--r-- | SConstruct | 16 | ||||
-rw-r--r-- | util/mmap.cpp | 13 | ||||
-rw-r--r-- | util/mmap.h | 2 | ||||
-rw-r--r-- | util/processinfo.cpp | 15 | ||||
-rw-r--r-- | util/processinfo.h | 2 |
5 files changed, 26 insertions, 22 deletions
diff --git a/SConstruct b/SConstruct index 4ee3b18f738..a566cf731c4 100644 --- a/SConstruct +++ b/SConstruct @@ -309,7 +309,7 @@ commonFiles = Split( "pch.cpp buildinfo.cpp db/common.cpp db/indexkey.cpp db/js commonFiles += [ "util/background.cpp" , "util/mmap.cpp" , "util/sock.cpp" , "util/util.cpp" , "util/file_allocator.cpp" , "util/message.cpp" , "util/assert_util.cpp" , "util/log.cpp" , "util/httpclient.cpp" , "util/md5main.cpp" , "util/base64.cpp", "util/concurrency/vars.cpp", "util/concurrency/task.cpp", "util/debug_util.cpp", "util/concurrency/thread_pool.cpp", "util/password.cpp", "util/version.cpp", "util/signal_handlers.cpp", - "util/histogram.cpp", "util/concurrency/spin_lock.cpp", "util/text.cpp" , "util/stringutils.cpp" , "util/processinfo.cpp" , + "util/histogram.cpp", "util/concurrency/spin_lock.cpp", "util/text.cpp" , "util/stringutils.cpp" , "util/concurrency/synchronization.cpp" ] commonFiles += Glob( "util/*.c" ) commonFiles += Split( "client/connpool.cpp client/dbclient.cpp client/dbclient_rs.cpp client/dbclientcursor.cpp client/model.cpp client/syncclusterconnection.cpp client/distlock.cpp s/shardconnection.cpp" ) @@ -323,17 +323,19 @@ elif os.sys.platform == "win32": else: commonFiles += [ "util/mmap_posix.cpp" ] -if os.path.exists( "util/processinfo_" + os.sys.platform + ".cpp" ): - commonFiles += [ "util/processinfo_" + os.sys.platform + ".cpp" ] -else: - commonFiles += [ "util/processinfo_none.cpp" ] - coreDbFiles = [ "db/commands.cpp" ] -coreServerFiles = [ "util/message_server_port.cpp" , +coreServerFiles = [ "util/processinfo.cpp" , "util/message_server_port.cpp" , "client/parallel.cpp" , "util/miniwebserver.cpp" , "db/dbwebserver.cpp" , "db/matcher.cpp" , "db/dbcommands_generic.cpp" ] +if os.path.exists( "util/processinfo_" + os.sys.platform + ".cpp" ): + coreServerFiles += [ "util/processinfo_" + os.sys.platform + ".cpp" ] +else: + coreServerFiles += [ "util/processinfo_none.cpp" ] + + + if has_option( "asio" ): coreServerFiles += [ "util/message_server_asio.cpp" ] diff --git a/util/mmap.cpp b/util/mmap.cpp index 4e60b4e6306..03b31975995 100644 --- a/util/mmap.cpp +++ b/util/mmap.cpp @@ -57,19 +57,6 @@ namespace mongo { return map( filename , l, options ); } - void printMemInfo( const char * where ) { - cout << "mem info: "; - if ( where ) - cout << where << " "; - ProcessInfo pi; - if ( ! pi.supported() ) { - cout << " not supported" << endl; - return; - } - - cout << "vsize: " << pi.getVirtualMemorySize() << " resident: " << pi.getResidentSize() << " mapped: " << ( MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ) ) << endl; - } - /* --- MongoFile ------------------------------------------------- this is the administrative stuff */ diff --git a/util/mmap.h b/util/mmap.h index beefa0fed80..8884a110ef4 100644 --- a/util/mmap.h +++ b/util/mmap.h @@ -187,8 +187,6 @@ namespace mongo { void* remapPrivateView(void *oldPrivateAddr); }; - void printMemInfo( const char * where ); - typedef MemoryMappedFile MMF; /** p is called from within a mutex that MongoFile uses. so be careful not to deadlock. */ diff --git a/util/processinfo.cpp b/util/processinfo.cpp index d6ba6baf1f7..2d5b6e3c3ad 100644 --- a/util/processinfo.cpp +++ b/util/processinfo.cpp @@ -17,6 +17,7 @@ #include "pch.h" #include "processinfo.h" +#include "mmap.h" #include <iostream> using namespace std; @@ -44,4 +45,18 @@ namespace mongo { pidFileWiper.write( path ); } + void printMemInfo( const char * where ) { + cout << "mem info: "; + if ( where ) + cout << where << " "; + ProcessInfo pi; + if ( ! pi.supported() ) { + cout << " not supported" << endl; + return; + } + + cout << "vsize: " << pi.getVirtualMemorySize() << " resident: " << pi.getResidentSize() << " mapped: " << ( MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ) ) << endl; + } + + } diff --git a/util/processinfo.h b/util/processinfo.h index 52b7fa3a8e6..b10e6fe9a38 100644 --- a/util/processinfo.h +++ b/util/processinfo.h @@ -62,4 +62,6 @@ namespace mongo { void writePidFile( const std::string& path ); + void printMemInfo( const char * where ); + } |