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

Create libstatistics_collector package #117

Merged
merged 17 commits into from Mar 30, 2020
Merged

Create libstatistics_collector package #117

merged 17 commits into from Mar 30, 2020

Conversation

dabonnie
Copy link
Contributor

@dabonnie dabonnie commented Mar 19, 2020

Create new libstatistics_collector library and copy relevant classes to new library

This is part of #224 to done.

Signed-off-by: Devin Bonnie dbbonnie@amazon.com

Move relevant classes

Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@dabonnie dabonnie added this to the Sprint #15 milestone Mar 19, 2020
@dabonnie dabonnie self-assigned this Mar 19, 2020
@codecov
Copy link

codecov bot commented Mar 19, 2020

Codecov Report

Merging #117 into master will decrease coverage by 5.23%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
- Coverage   38.77%   33.54%   -5.24%     
==========================================
  Files          39       26      -13     
  Lines        1488     1106     -382     
  Branches      908      724     -184     
==========================================
- Hits          577      371     -206     
+ Misses         67       63       -4     
+ Partials      844      672     -172     
Flag Coverage Δ
#unittests 33.54% <16.66%> (-5.24%) ⬇️
Impacted Files Coverage Δ
...em_metrics_collector/metrics_message_publisher.cpp 62.50% <ø> (ø)
...em_metrics_collector/metrics_message_publisher.hpp 100.00% <ø> (ø)
...em_metrics_collector/periodic_measurement_node.hpp 100.00% <ø> (ø)
...r/test/system_metrics_collector/test_functions.hpp 50.87% <ø> (ø)
...m_metrics_collector/test_linux_cpu_measurement.cpp 18.42% <ø> (ø)
...etrics_collector/test_linux_memory_measurement.cpp 20.86% <0.00%> (ø)
...tor/test_linux_process_memory_measurement_node.cpp 42.85% <0.00%> (ø)
...trics_collector/test_metrics_message_publisher.cpp 34.14% <ø> (ø)
...trics_collector/test_periodic_measurement_node.cpp 27.38% <0.00%> (ø)
...lector/test_linux_process_cpu_measurement_node.cpp 25.42% <50.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e672ed0...20f7160. Read the comment docs.

Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@dabonnie dabonnie marked this pull request as ready for review March 19, 2020 21:36
@dabonnie
Copy link
Contributor Author

Ah sorry, I marked this as ready for review, but neglected to move the topic statistics classes to the libcollector package.

Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@dabonnie
Copy link
Contributor Author

Will look into the decreased code coverage, waiting for the latest report.

Copy link

@zmichaels11 zmichaels11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only concern is that libcollector already exists and does something similar:

libcollector - API for the Performance Tools collector library

The shared object, libcollector.so, is used to collect performance data and is normally loaded using LD_PRELOAD by the collect command or by dbx when the Collector is enabled. 

libcollector/package.xml Outdated Show resolved Hide resolved
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@piraka9011
Copy link
Contributor

Ditto Zach's comment, I'm assuming this was part of the design discussion but any chance we can make the library name a bit less generic to avoid potential name clashes?

Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@dabonnie
Copy link
Contributor Author

It appears that we are generating reports for the system_metrics_collector package only via this report, so that would make sense why coverage decreased given the only changes are moving code.

statistics_collector_lib/CMakeLists.txt Outdated Show resolved Hide resolved
Comment on lines 76 to 79
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn'it the default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this tested on OS X and Windows? If ROS2 is depending on it, I guess we'll need to make sure it works too there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ARCHIVE and INCLUDES. Are you saying we should remove the whole thing?

statistics_collector_lib/CMakeLists.txt Outdated Show resolved Hide resolved
statistics_collector_lib/CMakeLists.txt Outdated Show resolved Hide resolved
statistics_collector_lib/CMakeLists.txt Outdated Show resolved Hide resolved
statistics_collector_lib/CMakeLists.txt Outdated Show resolved Hide resolved
statistics_collector_lib/include/collector/collector.hpp Outdated Show resolved Hide resolved
statistics_collector_lib/include/collector/collector.hpp Outdated Show resolved Hide resolved
statistics_collector_lib/include/collector/collector.hpp Outdated Show resolved Hide resolved
@thomas-moulard
Copy link
Member

SGTM with the structure cleanup, consider using a Pimpl to avoid leaking the mutex to your public header.

Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@dabonnie
Copy link
Contributor Author

Updated name and made sure tests are passing. Still needs the following:

  • update namespace (current libstatistics_collector namespaces should be nested under namespace libstatistics_collector
  • update libstatistics_collector and system_metrics_collector READMEs
  • cleanup libstatistics_collector CMakeLists.txt

ament_target_dependencies(test_received_message_age rcl rcpputils std_msgs sensor_msgs)
endif()

#todo remove?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll need this, my comment was about removing setting ARCHIVE, etc. explicitly because I'm not sure whether it'd work on Windows.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is also the wrong syntax for a todo comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ARCHIVE and INCLUDES (seeing as how there's a separate install() command that follows for the include/ directory).

@dabonnie dabonnie changed the title Create libstatistics_collector package [WIP] Create libstatistics_collector package Mar 26, 2020
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
@mm318
Copy link
Member

mm318 commented Mar 27, 2020

I've addressed #117 (comment). Can you please re-review, @dabonnie, especially the changes to the README.md?

@thomas-moulard thomas-moulard removed this from the Sprint #15 milestone Mar 30, 2020
@dabonnie dabonnie changed the title [WIP] Create libstatistics_collector package Create libstatistics_collector package Mar 30, 2020
Copy link
Contributor Author

@dabonnie dabonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I can't approve my own PR.

Copy link
Member

@thomas-moulard thomas-moulard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w/ ns cleaned-up

Copy link

@zmichaels11 zmichaels11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
You can skip the suggestions I left if you want.
I'd weigh the "move using into unnamed namespace" suggestions higher than using auto.

Signed-off-by: Miaofei <miaofei@amazon.com>
@mm318 mm318 merged commit 22f8de5 into master Mar 30, 2020
@mm318 mm318 deleted the dabonnie/libcollector branch March 30, 2020 23:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants