diff --git a/README.md b/README.md index 67b618f1..2e59341c 100644 --- a/README.md +++ b/README.md @@ -1 +1,12 @@ # system_metrics_collector + +Note: _This is currently an **experimental** package._ + +## MetricsMessage + +This message is used to publish the statistics of measured data points, e.g. system cpu %, system free memory, message age, etc. + +## License +The source code is released under an Apache 2.0. + +Maintainer: ROS Tooling Working Group, ros-tooling@googlegroups.com \ No newline at end of file diff --git a/metrics_statistics_msgs/CMakeLists.txt b/metrics_statistics_msgs/CMakeLists.txt index 753dc4ee..32155384 100644 --- a/metrics_statistics_msgs/CMakeLists.txt +++ b/metrics_statistics_msgs/CMakeLists.txt @@ -11,9 +11,16 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() +# Enable strict compiler flags if possible. +include(CheckCXXCompilerFlag) +# Removed -Wmissing-declarations until gmock is ignored +set(FLAGS -pedantic -Wno-long-long -Wall -Wextra -Wcast-qual -Wformat -Wwrite-strings -Wcast-align -Wno-error=cast-align) +foreach(FLAG ${FLAGS}) + check_cxx_compiler_flag(${FLAG} R${FLAG}) + if(${R${FLAG}}) + set(WARNING_CXX_FLAGS "${WARNING_CXX_FLAGS} ${FLAG}") + endif() +endforeach() # find dependencies find_package(ament_cmake REQUIRED) diff --git a/system_metrics_collector/CMakeLists.txt b/system_metrics_collector/CMakeLists.txt new file mode 100644 index 00000000..6b669d1b --- /dev/null +++ b/system_metrics_collector/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.5) +project(system_metrics_collector) + +# Default to C99 +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() + +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +# Enable strict compiler flags if possible. +include(CheckCXXCompilerFlag) +# Removed -Wmissing-declarations until gmock is ignored +set(FLAGS -pedantic -Wno-long-long -Wall -Wextra -Wcast-qual -Wformat -Wwrite-strings -Wcast-align -Wno-error=cast-align) +foreach(FLAG ${FLAGS}) + check_cxx_compiler_flag(${FLAG} R${FLAG}) + if(${R${FLAG}}) + set(WARNING_CXX_FLAGS "${WARNING_CXX_FLAGS} ${FLAG}") + endif() +endforeach() + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(rclcpp REQUIRED) +find_package(rcutils REQUIRED) +find_package(metrics_statistics_msgs REQUIRED) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # uncomment the line when a copyright and license is not present in all source files + #set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # uncomment the line when this package is not in a git repo + #set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/system_metrics_collector/package.xml b/system_metrics_collector/package.xml new file mode 100644 index 00000000..1354656e --- /dev/null +++ b/system_metrics_collector/package.xml @@ -0,0 +1,26 @@ + + + + system_metrics_collector + 0.0.0 + Node and aggregation utilities to measure and publish system metrics. + ROS Tooling Working Group + Apache License 2.0 + + ament_cmake + + rclcpp + rcutils + metrics_statistics_msgs + + rclcpp + rcutils + metrics_statistics_msgs + + ament_lint_auto + ament_lint_common + + + ament_cmake + +