Skip to content

Commit

Permalink
[EN-7490] Implement Tools
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyKalin committed Sep 12, 2023
1 parent ef9ba13 commit 9e1b580
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion tools/Tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<TARGET_FILE:dxfcxx::graal> $<TARGET_FILE_DIR:${PROJECT_NAME}>)
Expand Down
12 changes: 12 additions & 0 deletions tools/Tools/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@

#include <dxfeed_graal_cpp_api/api.hpp>
#include "PerfTest/PerfTestTool.hpp"
#include <process/process.hpp>

#include <variant>

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;
}

0 comments on commit 9e1b580

Please sign in to comment.