summaryrefslogtreecommitdiff
path: root/src/mongo/util/processinfo.h
diff options
context:
space:
mode:
authorWaley Chen <waleycz@gmail.com>2016-02-25 18:09:15 -0500
committerWaley Chen <waleycz@gmail.com>2016-02-26 16:58:34 -0500
commit7f7a64a1d6ef791d3b111245301d73902e9e4875 (patch)
tree37685005da6ebc7afb34eb5253aa5823a2ef41fd /src/mongo/util/processinfo.h
parent6e95475c55642d97e316467fa2adeb38edc6d762 (diff)
downloadmongo-7f7a64a1d6ef791d3b111245301d73902e9e4875.tar.gz
SERVER-22398 Add SystemInfo::numAvailableCores
Diffstat (limited to 'src/mongo/util/processinfo.h')
-rw-r--r--src/mongo/util/processinfo.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/util/processinfo.h b/src/mongo/util/processinfo.h
index 86305a9babe..7d48fe31aea 100644
--- a/src/mongo/util/processinfo.h
+++ b/src/mongo/util/processinfo.h
@@ -29,6 +29,7 @@
#pragma once
+#include <boost/optional.hpp>
#include <cstdint>
#include <string>
@@ -89,6 +90,12 @@ public:
}
/**
+ * Get the number of available CPUs. Depending on the OS, the number can be the
+ * number of available CPUs to the current process or scheduler.
+ */
+ boost::optional<unsigned long> getNumAvailableCores();
+
+ /**
* Get the number of CPUs
*/
unsigned getNumCores() const {