Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Add system_metrics_collector package (#2)
Browse files Browse the repository at this point in the history
Add strict compile flags
  • Loading branch information
dabonnie committed Nov 1, 2019
1 parent a2bdc79 commit bd578da
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 3 deletions.
11 changes: 11 additions & 0 deletions 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
13 changes: 10 additions & 3 deletions metrics_statistics_msgs/CMakeLists.txt
Expand Up @@ -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)
Expand Down
42 changes: 42 additions & 0 deletions 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()
26 changes: 26 additions & 0 deletions system_metrics_collector/package.xml
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>system_metrics_collector</name>
<version>0.0.0</version>
<description>Node and aggregation utilities to measure and publish system metrics.</description>
<maintainer email="ros-tooling@googlegroups.com">ROS Tooling Working Group</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>rclcpp</build_depend>
<build_depend>rcutils</build_depend>
<build_depend>metrics_statistics_msgs</build_depend>

<exec_depend>rclcpp</exec_depend>
<exec_depend>rcutils</exec_depend>
<exec_depend>metrics_statistics_msgs</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

0 comments on commit bd578da

Please sign in to comment.