Add SubscriberTopicStatisticsNode and tests #112
Conversation
988bb36
to
da58418
Compare
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
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.
A lot of the code in SubscriberTopicStatistics
look the same as the PeriodicMeasurementNode
. Can they be refactored to have a common base class?
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
da58418
to
67f0fc5
Compare
Codecov Report
@@ Coverage Diff @@
## master #112 +/- ##
==========================================
+ Coverage 33.54% 35.06% +1.52%
==========================================
Files 26 29 +3
Lines 1106 1363 +257
Branches 724 878 +154
==========================================
+ Hits 371 478 +107
- Misses 63 81 +18
- Partials 672 804 +132
Continue to review full report at Codecov.
|
67f0fc5
to
e57a4d1
Compare
2b8b9ba
to
63a0924
Compare
system_metrics_collector/src/topic_statistics_collector/constants.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
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.
This is a fairly large PR (currently +849) and isn't the easiest to review: I probably need to make another pass. If possible I would suggest breaking this up.
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Show resolved
Hide resolved
98825b6
to
5202ef8
Compare
Refactored version is smaller and more straight-forward imo. Figured it's easier to view class+unit tests together, if not I can separate the two into different PRs. |
5202ef8
to
176b502
Compare
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.
This is getting close. Once the lifecycle transitions are fixed this is pretty much done.
system_metrics_collector/src/topic_statistics_collector/constants.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/constants.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Outdated
Show resolved
Hide resolved
176b502
to
3939d08
Compare
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
f4831cb
to
905edff
Compare
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
905edff
to
c197e22
Compare
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Show resolved
Hide resolved
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.
minor non-blocking nits
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/topic_statistics_collector/subscriber_topic_statistics.hpp
Outdated
Show resolved
Hide resolved
@@ -27,6 +27,7 @@ | |||
<test_depend>ament_lint_common</test_depend> | |||
<test_depend>class_loader</test_depend> | |||
<test_depend>lifecycle_msgs</test_depend> | |||
<test_depend>sensor_msgs</test_depend> |
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.
can we avoid this by using a dummy message in the test folder?
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.
Yes it is possible to use a dummy message with Header. Currently multiple packages use IMU messages in tests, I have filed #120 to change them.
/** | ||
* Class which makes periodic topic statistics measurements, using a ROS2 timer. | ||
*/ | ||
template<typename T> |
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.
Please document what is T here. Can we add a static_assert
to make sure only "allowed types" are passed?
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.
T
here is for any ROS 2 message type. I'm not sure how we can enforce that using static_assert
?
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Show resolved
Hide resolved
system_metrics_collector/test/topic_statistics_collector/test_subscriber_topic_statistics.cpp
Show resolved
Hide resolved
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
e18c89f
to
0564745
Compare
Related to https://github.com/ros-tooling/aws-roadmap/issues/197
Signed-off-by: Prajakta Gokhale prajaktg@amazon.com