diff --git a/CMakeLists.txt b/CMakeLists.txt index b32040a1..795157e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,9 @@ endif () FetchContent_MakeAvailable(DxFeedGraalNativeSdk) # DxFeedGraalNativeSdk_SOURCE_DIR +FetchContent_Declare(Process GIT_REPOSITORY "https://github.com/ttldtor/Process.git" GIT_TAG default) +FetchContent_MakeAvailable(Process) + add_subdirectory(third_party/utfcpp-3.2.3) set(FMT_INSTALL OFF) add_subdirectory(third_party/fmt-10.0.0) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 0bcad066..0918315b 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -7,7 +7,8 @@ - [fmt](https://github.com/fmtlib/fmt) v10.0.0 - [doctest](https://github.com/doctest/doctest) v2.4.11 (Tests) - [range-v3](https://github.com/ericniebler/range-v3) v0.12 -- [date] (https://github.com/HowardHinnant/date) v3.0.1 +- [date](https://github.com/HowardHinnant/date) v3.0.1 +- [Process](https://github.com/ttldtor/Process) v1.0.0 (Tools) ## Run-time diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index 8103b81d..58499dbf 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -6,8 +6,10 @@ SPDX-License-Identifier: MIT 3. doctest - https://github.com/doctest/doctest/blob/master/LICENSE.txt SPDX-License-Identifier: MIT -4. range-v3 - https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt +4. range-v3 - https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt SPDX-License-Identifier: BSL-1.0 -5. date - https://github.com/HowardHinnant/date/blob/master/LICENSE.txt +5. date - https://github.com/HowardHinnant/date/blob/master/LICENSE.txt SPDX-License-Identifier: MIT +6. Process - https://github.com/ttldtor/Process/blob/default/LICENSE + SPDX-License-Identifier: BSL-1.0 \ No newline at end of file diff --git a/tools/Tools/CMakeLists.txt b/tools/Tools/CMakeLists.txt index 75e25a86..538c9d19 100644 --- a/tools/Tools/CMakeLists.txt +++ b/tools/Tools/CMakeLists.txt @@ -40,7 +40,7 @@ add_executable(${PROJECT_NAME} src/PerfTest/PerfTestTool.cpp ) -target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx::static) +target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx::static process::process) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $) diff --git a/tools/Tools/src/main.cpp b/tools/Tools/src/main.cpp index 32d3a31f..170db714 100644 --- a/tools/Tools/src/main.cpp +++ b/tools/Tools/src/main.cpp @@ -3,9 +3,21 @@ #include #include "PerfTest/PerfTestTool.hpp" +#include #include +using namespace std::literals; +using namespace dxfcpp; +using namespace dxfcpp::literals; +using namespace ttldtor::process; + int main() { + std::cout << "Memory usage: " << Process::getPhysicalMemorySize() / 1024 << "KB" << std::endl; + std::cout << "Total CPU time: " << Process::getTotalProcessorTime().count() << "ms" << std::endl; + dxfcpp::DXFeed::getInstance(); + + std::cout << "Memory usage: " << Process::getPhysicalMemorySize() / 1024 << "KB" << std::endl; + std::cout << "Total CPU time: " << Process::getTotalProcessorTime().count() << "ms" << std::endl; } \ No newline at end of file