-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new messages for topic statistics #98
Merged
dirk-thomas
merged 3 commits into
ros2:master
from
aws-ros-dev:prajaktg/add-metrics-msgs
Apr 17, 2020
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(statistics_msgs) | ||
|
||
# Default to C++14 | ||
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() | ||
|
||
# Find dependencies | ||
find_package(ament_cmake REQUIRED) | ||
find_package(builtin_interfaces REQUIRED) | ||
find_package(rosidl_default_generators REQUIRED) | ||
|
||
# Generate added messages with dependencies listed here | ||
rosidl_generate_interfaces(${PROJECT_NAME} | ||
"msg/MetricsMessage.msg" | ||
"msg/StatisticDataPoint.msg" | ||
"msg/StatisticDataType.msg" | ||
DEPENDENCIES builtin_interfaces | ||
) | ||
|
||
ament_export_dependencies(rosidl_default_runtime) | ||
|
||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# metrics_statistics_msgs | ||
|
||
Package containing ROS 2 message definitions for reporting | ||
statistics for topics and system resources. | ||
|
||
## Messages defined in this package | ||
|
||
1. StatisticDataType | ||
|
||
A message that represent the types of statistics reported. | ||
This defines the following data types that can be used to represent | ||
individual metric data points. | ||
* `average` | ||
* `minimum` | ||
* `maximum` | ||
* `stddev` | ||
* `sample_count` | ||
|
||
1. StatisticDataPoint | ||
|
||
A message that represents a single statistic value. | ||
This includes: | ||
* `data_type`: Type of the metric data point, as defined in `StatisticDataType`. | ||
* `data`: Value of the metric data point. | ||
|
||
1. MetricsMessage | ||
|
||
A message that represents statistic data measured from a source | ||
within a time window. | ||
This includes: | ||
* `measurement_source_name`: Source from where the measurement or statistic originates. | ||
* `metrics_source`: Name of the metric. | ||
* `unit`: Unit representing the metric. | ||
* `window_start`: Start time of the metric measurement window. | ||
* `window_stop`: End time of the metric measurement window. | ||
* `statistics`: A list of `StatisticDataPoint` representing the values | ||
of collected metrics. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
############################################# | ||
# A generic metrics message providing statistics for measurements from different sources. For example, | ||
# measure a system's CPU % for a given window yields the following data points over a window of time: | ||
# | ||
# - average cpu % | ||
# - std deviation | ||
# - min | ||
# - max | ||
# - sample count | ||
# | ||
# These are all represented as different 'StatisticDataPoint's. | ||
############################################# | ||
|
||
# Name metric measurement source, e.g., node, topic, or process name | ||
string measurement_source_name | ||
|
||
# Name of the metric being measured, e.g. cpu_percentage, free_memory_mb, message_age, etc. | ||
string metrics_source | ||
|
||
# Unit of measure of the metric, e.g. percent, mb, seconds, etc. | ||
string unit | ||
|
||
# Measurement window start time | ||
builtin_interfaces/Time window_start | ||
|
||
# Measurement window end time | ||
builtin_interfaces/Time window_stop | ||
|
||
# A list of statistics data point, defined in StatisticDataPoint.msg | ||
StatisticDataPoint[] statistics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
############################################# | ||
# This holds the structure of a single data point of a StatisticDataType. | ||
# | ||
# This message is used in MetricsStatisticsMessage, defined in MetricsStatisticsMessage.msg. | ||
# | ||
# Examples of the value of data point are | ||
# - average size of messages received | ||
# - standard deviation of the period of messages published | ||
# - maximum age of messages published | ||
# | ||
# A value of nan represents no data is available. | ||
# One example is that standard deviation is only available when there are two or more data points but there is only one, | ||
# and in this case the value would be nan. | ||
# +inf and -inf are not allowed. | ||
# | ||
############################################# | ||
|
||
# The statistic type of this data point, defined in StatisticDataType.msg | ||
# Default value should be StatisticDataType.STATISTICS_DATA_TYPE_UNINITIALIZED (0). | ||
uint8 data_type | ||
|
||
# The value of the data point | ||
float64 data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
############################################# | ||
# This file contains the commonly used constants for the statistics data type. | ||
# | ||
# The value 0 is reserved for unitialized statistic message data type. | ||
# Range of values: [0, 255]. | ||
# Unallowed values: any value that is not specified in this file. | ||
# | ||
############################################# | ||
|
||
# Constant for uninitialized | ||
uint8 STATISTICS_DATA_TYPE_UNINITIALIZED = 0 | ||
|
||
# Allowed values | ||
uint8 STATISTICS_DATA_TYPE_AVERAGE = 1 | ||
uint8 STATISTICS_DATA_TYPE_MINIMUM = 2 | ||
uint8 STATISTICS_DATA_TYPE_MAXIMUM = 3 | ||
uint8 STATISTICS_DATA_TYPE_STDDEV = 4 | ||
uint8 STATISTICS_DATA_TYPE_SAMPLE_COUNT = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?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>statistics_msgs</name> | ||
prajakta-gokhale marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<version>0.8.0</version> | ||
<description>Message definitions for reporting statistics for topics and system resources.</description> | ||
<maintainer email="ros-tooling@googlegroups.com">ROS Tooling Working Group</maintainer> | ||
<license>Apache License 2.0</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<buildtool_depend>rosidl_default_generators</buildtool_depend> | ||
|
||
<build_depend>builtin_interfaces</build_depend> | ||
|
||
<build_export_depend>builtin_interfaces</build_export_depend> | ||
|
||
<exec_depend>builtin_interfaces</exec_depend> | ||
<exec_depend>rosidl_default_runtime</exec_depend> | ||
|
||
<test_depend>ament_lint_common</test_depend> | ||
|
||
<member_of_group>rosidl_interface_packages</member_of_group> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to check the generated code on how these comments appear in docblocks. I would guess this one will be associated with the first enum which seems weird.