1
0
Fork 0

added reactor type

This commit is contained in:
jsteemann 2017-02-07 12:41:41 +01:00
parent 76956d755f
commit d503a4d354
8 changed files with 20 additions and 60 deletions

View File

@ -32,7 +32,6 @@
#include "Basics/StaticStrings.h" #include "Basics/StaticStrings.h"
#include "Logger/Logger.h" #include "Logger/Logger.h"
#include "Rest/HttpRequest.h" #include "Rest/HttpRequest.h"
#include "Rest/Version.h"
using namespace arangodb; using namespace arangodb;

View File

@ -32,7 +32,6 @@
#include "Logger/Logger.h" #include "Logger/Logger.h"
#include "Rest/HttpRequest.h" #include "Rest/HttpRequest.h"
#include "Rest/Version.h"
using namespace arangodb; using namespace arangodb;

View File

@ -28,8 +28,6 @@
#include "Basics/Common.h" #include "Basics/Common.h"
#include <boost/lockfree/queue.hpp>
#include "Basics/ConditionVariable.h" #include "Basics/ConditionVariable.h"
#include "Endpoint/ConnectionInfo.h" #include "Endpoint/ConnectionInfo.h"
#include "GeneralServer/GeneralDefinitions.h" #include "GeneralServer/GeneralDefinitions.h"

View File

@ -41,7 +41,6 @@
#include "ProgramOptions/Parameters.h" #include "ProgramOptions/Parameters.h"
#include "ProgramOptions/ProgramOptions.h" #include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h" #include "ProgramOptions/Section.h"
#include "Rest/Version.h"
#include "RestHandler/RestAdminLogHandler.h" #include "RestHandler/RestAdminLogHandler.h"
#include "RestHandler/RestAqlFunctionsHandler.h" #include "RestHandler/RestAqlFunctionsHandler.h"
#include "RestHandler/RestAuthHandler.h" #include "RestHandler/RestAuthHandler.h"

View File

@ -24,10 +24,8 @@
#include "RestDebugHandler.h" #include "RestDebugHandler.h"
#include "Rest/HttpRequest.h" #include "Rest/HttpRequest.h"
#include "Rest/Version.h"
using namespace arangodb; using namespace arangodb;
using namespace arangodb::basics; using namespace arangodb::basics;
using namespace arangodb::rest; using namespace arangodb::rest;

View File

@ -29,8 +29,6 @@
#include "Logger/Logger.h" #include "Logger/Logger.h"
#include "ProgramOptions/ProgramOptions.h" #include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h" #include "ProgramOptions/Section.h"
#include "Rest/HttpRequest.h"
#include "Rest/Version.h"
#include "RestServer/DatabaseFeature.h" #include "RestServer/DatabaseFeature.h"
#include "RestServer/VocbaseContext.h" #include "RestServer/VocbaseContext.h"
#include "Scheduler/SchedulerFeature.h" #include "Scheduler/SchedulerFeature.h"

View File

@ -36,6 +36,7 @@
#include "Basics/StringUtils.h" #include "Basics/StringUtils.h"
#include "Basics/Utf8Helper.h" #include "Basics/Utf8Helper.h"
#include "Basics/asio-helper.h"
#include "Basics/build-date.h" #include "Basics/build-date.h"
#include "Basics/build-repository.h" #include "Basics/build-repository.h"
#include "Basics/conversions.h" #include "Basics/conversions.h"
@ -46,12 +47,9 @@ using namespace arangodb::rest;
std::map<std::string, std::string> Version::Values; std::map<std::string, std::string> Version::Values;
////////////////////////////////////////////////////////////////////////////////
/// @brief parse a version string into major, minor /// @brief parse a version string into major, minor
/// returns -1, -1 when the version string has an invalid format /// returns -1, -1 when the version string has an invalid format
/// returns major, -1 when only the major version can be determined /// returns major, -1 when only the major version can be determined
////////////////////////////////////////////////////////////////////////////////
std::pair<int, int> Version::parseVersionString(std::string const& str) { std::pair<int, int> Version::parseVersionString(std::string const& str) {
std::pair<int, int> result{ -1, -1 }; std::pair<int, int> result{ -1, -1 };
@ -81,10 +79,7 @@ std::pair<int, int> Version::parseVersionString(std::string const& str) {
return result; return result;
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief initialize /// @brief initialize
////////////////////////////////////////////////////////////////////////////////
void Version::initialize() { void Version::initialize() {
if (!Values.empty()) { if (!Values.empty()) {
return; return;
@ -111,6 +106,7 @@ void Version::initialize() {
Values["icu-version"] = getICUVersion(); Values["icu-version"] = getICUVersion();
Values["openssl-version"] = getOpenSSLVersion(); Values["openssl-version"] = getOpenSSLVersion();
Values["platform"] = TRI_PLATFORM; Values["platform"] = TRI_PLATFORM;
Values["reactor-type"] = getBoostReactorType();
Values["server-version"] = getServerVersion(); Values["server-version"] = getServerVersion();
Values["sizeof int"] = arangodb::basics::StringUtils::itoa(sizeof(int)); Values["sizeof int"] = arangodb::basics::StringUtils::itoa(sizeof(int));
Values["sizeof void*"] = arangodb::basics::StringUtils::itoa(sizeof(void*)); Values["sizeof void*"] = arangodb::basics::StringUtils::itoa(sizeof(void*));
@ -193,10 +189,7 @@ void Version::initialize() {
} }
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get numeric server version /// @brief get numeric server version
////////////////////////////////////////////////////////////////////////////////
int32_t Version::getNumericServerVersion() { int32_t Version::getNumericServerVersion() {
char const* apiVersion = ARANGODB_VERSION; char const* apiVersion = ARANGODB_VERSION;
char const* p = apiVersion; char const* p = apiVersion;
@ -222,16 +215,10 @@ int32_t Version::getNumericServerVersion() {
return (int32_t)(minor * 100L + major * 10000L); return (int32_t)(minor * 100L + major * 10000L);
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get server version /// @brief get server version
////////////////////////////////////////////////////////////////////////////////
std::string Version::getServerVersion() { return std::string(ARANGODB_VERSION); } std::string Version::getServerVersion() { return std::string(ARANGODB_VERSION); }
////////////////////////////////////////////////////////////////////////////////
/// @brief get BOOST version /// @brief get BOOST version
////////////////////////////////////////////////////////////////////////////////
std::string Version::getBoostVersion() { std::string Version::getBoostVersion() {
#ifdef ARANGODB_BOOST_VERSION #ifdef ARANGODB_BOOST_VERSION
return std::string(ARANGODB_BOOST_VERSION); return std::string(ARANGODB_BOOST_VERSION);
@ -240,10 +227,22 @@ std::string Version::getBoostVersion() {
#endif #endif
} }
//////////////////////////////////////////////////////////////////////////////// /// @brief get boost reactor type
/// @brief get V8 version std::string Version::getBoostReactorType() {
//////////////////////////////////////////////////////////////////////////////// #if defined(BOOST_ASIO_HAS_IOCP)
return std::string("iocp");
#elif defined(BOOST_ASIO_HAS_EPOLL)
return std::string("epoll");
#elif defined(BOOST_ASIO_HAS_KQUEUE)
return std::string("kqueue");
#elif defined(BOOST_ASIO_HAS_DEV_POLL)
return std::string("/dev/poll");
#else
return std::string("select");
#endif
}
/// @brief get V8 version
std::string Version::getV8Version() { std::string Version::getV8Version() {
#ifdef ARANGODB_V8_VERSION #ifdef ARANGODB_V8_VERSION
return std::string(ARANGODB_V8_VERSION); return std::string(ARANGODB_V8_VERSION);
@ -252,10 +251,7 @@ std::string Version::getV8Version() {
#endif #endif
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get OpenSSL version /// @brief get OpenSSL version
////////////////////////////////////////////////////////////////////////////////
std::string Version::getOpenSSLVersion() { std::string Version::getOpenSSLVersion() {
#ifdef OPENSSL_VERSION_TEXT #ifdef OPENSSL_VERSION_TEXT
return std::string(OPENSSL_VERSION_TEXT); return std::string(OPENSSL_VERSION_TEXT);
@ -266,18 +262,12 @@ std::string Version::getOpenSSLVersion() {
#endif #endif
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get vpack version /// @brief get vpack version
////////////////////////////////////////////////////////////////////////////////
std::string Version::getVPackVersion() { std::string Version::getVPackVersion() {
return arangodb::velocypack::Version::BuildVersion.toString(); return arangodb::velocypack::Version::BuildVersion.toString();
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get zlib version /// @brief get zlib version
////////////////////////////////////////////////////////////////////////////////
std::string Version::getZLibVersion() { std::string Version::getZLibVersion() {
#ifdef ARANGODB_ZLIB_VERSION #ifdef ARANGODB_ZLIB_VERSION
return std::string(ARANGODB_ZLIB_VERSION); return std::string(ARANGODB_ZLIB_VERSION);
@ -286,10 +276,7 @@ std::string Version::getZLibVersion() {
#endif #endif
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get ICU version /// @brief get ICU version
////////////////////////////////////////////////////////////////////////////////
std::string Version::getICUVersion() { std::string Version::getICUVersion() {
UVersionInfo icuVersion; UVersionInfo icuVersion;
char icuVersionString[U_MAX_VERSION_STRING_LENGTH]; char icuVersionString[U_MAX_VERSION_STRING_LENGTH];
@ -299,10 +286,7 @@ std::string Version::getICUVersion() {
return icuVersionString; return icuVersionString;
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get compiler /// @brief get compiler
////////////////////////////////////////////////////////////////////////////////
std::string Version::getCompiler() { std::string Version::getCompiler() {
#if defined(__clang__) #if defined(__clang__)
return "clang [" + std::string(__VERSION__) + "]"; return "clang [" + std::string(__VERSION__) + "]";
@ -315,10 +299,7 @@ std::string Version::getCompiler() {
#endif #endif
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get endianness /// @brief get endianness
////////////////////////////////////////////////////////////////////////////////
std::string Version::getEndianness() { std::string Version::getEndianness() {
uint64_t value = 0x12345678abcdef99; uint64_t value = 0x12345678abcdef99;
static_assert(sizeof(value) == 8, "unexpected uint64_t size"); static_assert(sizeof(value) == 8, "unexpected uint64_t size");
@ -334,10 +315,7 @@ std::string Version::getEndianness() {
return "unknown"; return "unknown";
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get build date /// @brief get build date
////////////////////////////////////////////////////////////////////////////////
std::string Version::getBuildDate() { std::string Version::getBuildDate() {
// the OpenSuSE build system does not like it, if __DATE__ is used // the OpenSuSE build system does not like it, if __DATE__ is used
#ifdef ARANGODB_BUILD_DATE #ifdef ARANGODB_BUILD_DATE
@ -347,10 +325,7 @@ std::string Version::getBuildDate() {
#endif #endif
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get build repository /// @brief get build repository
////////////////////////////////////////////////////////////////////////////////
std::string Version::getBuildRepository() { std::string Version::getBuildRepository() {
#ifdef HAVE_ARANGODB_BUILD_REPOSITORY #ifdef HAVE_ARANGODB_BUILD_REPOSITORY
return std::string(ARANGODB_BUILD_REPOSITORY); return std::string(ARANGODB_BUILD_REPOSITORY);
@ -359,10 +334,7 @@ std::string Version::getBuildRepository() {
#endif #endif
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief return a server version string /// @brief return a server version string
////////////////////////////////////////////////////////////////////////////////
std::string Version::getVerboseVersionString() { std::string Version::getVerboseVersionString() {
std::ostringstream version; std::ostringstream version;
@ -388,10 +360,7 @@ std::string Version::getVerboseVersionString() {
return version.str(); return version.str();
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get detailed version information as a (multi-line) string /// @brief get detailed version information as a (multi-line) string
////////////////////////////////////////////////////////////////////////////////
std::string Version::getDetailed() { std::string Version::getDetailed() {
std::string result; std::string result;
@ -413,10 +382,7 @@ std::string Version::getDetailed() {
return result; return result;
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief VelocyPack all data /// @brief VelocyPack all data
////////////////////////////////////////////////////////////////////////////////
void Version::getVPack(VPackBuilder& dst) { void Version::getVPack(VPackBuilder& dst) {
TRI_ASSERT(!dst.isClosed()); TRI_ASSERT(!dst.isClosed());

View File

@ -86,6 +86,9 @@ class Version {
/// @brief get BOOST version /// @brief get BOOST version
static std::string getBoostVersion(); static std::string getBoostVersion();
/// @brief get boost reactor type
static std::string getBoostReactorType();
/// @brief get V8 version /// @brief get V8 version
static std::string getV8Version(); static std::string getV8Version();