summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2011-10-10 18:11:06 -0400
committerEliot Horowitz <eliot@10gen.com>2011-11-21 17:50:34 -0500
commite9ec52c686315e4388a5e26c22f274621339d849 (patch)
treeafc50f5522a96a7038f69aa8fc30e9d2feb9edd1 /util
parentd69d52ceef293c7888eb9c507dacf40a48b8abe0 (diff)
downloadmongo-e9ec52c686315e4388a5e26c22f274621339d849.tar.gz
add some extra_info for windows serverStatus output
Diffstat (limited to 'util')
-rw-r--r--util/processinfo_win32.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/util/processinfo_win32.cpp b/util/processinfo_win32.cpp
index ec66aec3e34..fdd88d374ac 100644
--- a/util/processinfo_win32.cpp
+++ b/util/processinfo_win32.cpp
@@ -19,7 +19,7 @@
#include "processinfo.h"
#include <iostream>
#include <psapi.h>
-
+#include "../bson/bsonobjbuilder.h"
using namespace std;
int getpid() {
@@ -57,7 +57,20 @@ namespace mongo {
return _wconvertmtos( pmc.WorkingSetSize );
}
- void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {}
+ void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
+ MEMORYSTATUSEX mse;
+ mse.dwLength = sizeof(mse);
+ PROCESS_MEMORY_COUNTERS pmc;
+ if( GetProcessMemoryInfo( GetCurrentProcess() , &pmc, sizeof(pmc) ) ) {
+ info.append("page_faults", static_cast<int>(pmc.PageFaultCount));
+ info.append("usagePageFileMB", static_cast<int>(pmc.PagefileUsage / 1024 / 1024));
+ }
+ if( GlobalMemoryStatusEx( &mse ) ) {
+ info.append("totalPageFileMB", static_cast<int>(mse.ullTotalPageFile / 1024 / 1024));
+ info.append("availPageFileMB", static_cast<int>(mse.ullAvailPageFile / 1024 / 1024));
+ info.append("ramMB", static_cast<int>(mse.ullTotalPhys / 1024 / 1024));
+ }
+ }
bool ProcessInfo::blockCheckSupported() {
return false;