summaryrefslogtreecommitdiff
path: root/util/processinfo_win32.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-12-15 10:02:19 +0100
committerAntonin Kral <a.kral@bobek.cz>2011-12-15 10:02:46 +0100
commit0b48f8ada2acb0de830b23f8cefc8e3fea28d915 (patch)
treef7c2811269b6b53199412be2dd5ec02eea15d55d /util/processinfo_win32.cpp
parent85f1cd56145b90a32b7ccdc750000deeed54fe22 (diff)
parentf0d9a01bccdaeb466c12c92057914bbfef59526c (diff)
downloadmongodb-0b48f8ada2acb0de830b23f8cefc8e3fea28d915.tar.gz
Merge branch 'upstream/2.0.2'
Diffstat (limited to 'util/processinfo_win32.cpp')
-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 ec66aec..fdd88d3 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;