Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3364873
D5112.id16583.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
924 B
Referenced Files
None
Subscribers
None
D5112.id16583.diff
View Options
diff --git a/services/lib/src/GlobalTools.h b/services/lib/src/GlobalTools.h
--- a/services/lib/src/GlobalTools.h
+++ b/services/lib/src/GlobalTools.h
@@ -13,6 +13,8 @@
bool hasEnvFlag(const std::string &flag);
+size_t getNumberOfCpus();
+
std::string decorateTableName(const std::string &baseName);
bool isSandbox();
diff --git a/services/lib/src/GlobalTools.cpp b/services/lib/src/GlobalTools.cpp
--- a/services/lib/src/GlobalTools.cpp
+++ b/services/lib/src/GlobalTools.cpp
@@ -10,6 +10,7 @@
#include <iomanip>
#include <regex>
#include <string>
+#include <thread>
namespace comm {
namespace network {
@@ -28,6 +29,10 @@
return std::string(std::getenv(flag.c_str())) == "1";
}
+size_t getNumberOfCpus() {
+ return (size_t)std::thread::hardware_concurrency();
+}
+
std::string decorateTableName(const std::string &baseName) {
std::string suffix = "";
if (hasEnvFlag("COMM_TEST_SERVICES")) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 5:34 AM (13 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2583118
Default Alt Text
D5112.id16583.diff (924 B)
Attached To
Mode
D5112: [services] Rust Integration - c++ - Add getNumberOfCores
Attached
Detach File
Event Timeline
Log In to Comment