-

Repository Summary

Checkout URI https://github.com/aws-robotics/health-metrics-collector-ros1.git
VCS Type git
VCS Version master
Last Updated 2022-02-08
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
health_metric_collector 2.0.2

README

health_metric_collector

Overview

This health_metric_collector ROS node collects system metrics and publishes them to /metrics topic. The cloudwatch_metrics_collector node is subscribed to this topic and will publish the metrics to AWS CloudWatch when it is instantiated.

Keywords: ROS, AWS, CloudWatch, Metrics

License

The source code is released under an Apache 2.0.

Author: AWS RoboMaker
Affiliation: Amazon Web Services (AWS)

RoboMaker cloud extensions rely on third-party software licensed under open-source licenses and are provided for demonstration purposes only. Incorporation or use of RoboMaker cloud extensions in connection with your production workloads or commercial product(s) or devices may affect your legal rights or obligations under the applicable open-source licenses. License information for this repository can be found here. AWS does not provide support for this cloud extension. You are solely responsible for how you configure, deploy, and maintain this cloud extension in your workloads or commercial product(s) or devices.

Supported ROS Distributions

  • Kinetic
  • Melodic

Installation

AWS Credentials

You will need to create an AWS Account and configure the credentials to be able to communicate with AWS services. You may find AWS Configuration and Credential Files helpful. Specifying AWS credentials by setting environment variables is not supported.

This node will require the following AWS account IAM role permissions:

  • cloudwatch:PutMetricData

Building from Source

To build from source you’ll need to create a new workspace, clone and checkout the latest release branch of this repository, install all the dependencies, and compile. If you need the latest development features you can clone from the master branch instead of the latest release branch. While we guarantee the release branches are stable, the master should be considered to have an unstable build due to ongoing development.

  • Install build tool: please refer to colcon installation guide

  • Create a ROS workspace and a source directory

      mkdir -p ~/ros-workspace/src
    
  • Clone the package into the source directory .

      cd ~/ros-workspace/src
      git clone https://github.com/aws-robotics/health-metrics-collector-ros1.git -b release-latest
    
  • Install dependencies

      cd ~/ros-workspace 
      sudo apt-get update && rosdep update
      rosdep install --from-paths src --ignore-src -r -y
    

Note: If building the master branch instead of a release branch you may need to also checkout and build the master branches of the packages this package depends on.

  • Build the packages

      cd ~/ros-workspace && colcon build
    
  • Configure ROS library Path

      source ~/ros-workspace/install/setup.bash
    
  • Build and run the unit tests

      colcon build --packages-select health_metric_collector --cmake-target tests
      colcon test --packages-select health_metric_collector && colcon test-result --all
    

Launch Files

An example launch file called sample_application.launch is included in this project that gives an example of how you can include this node in your project together with the cloudwatch_metrics_collector node.

Usage

Run the node

  • With launch file:
    • ROS: roslaunch health_metric_collector sample_application.launch
  • Without launch file using default values
    • ROS: rosrun health_metric_collector health_metric_collector

Running the sample application

To launch the sample application for the metrics node you can run the following command:

roslaunch health_metric_collector sample_application.launch --screen

Configuration file and Parameters

The health_metric_collector node receives an interval parameter that indicates the frequency in which it should sample metrics. e.g. interval=5 indicates sampling every five seconds. The default value is 5.

Supported Metrics Types

  • Free RAM (in MB)
  • Total RAM (in MB)
  • Total cpu usage (percentage)
  • Per core cpu usage (percentage)
  • Uptime (in sec)
  • Number of processes

Performance and Benchmark Results

We evaluated the performance of this node by runnning the followning scenario on a Raspberry Pi 3 Model B:

  • Launch a baseline graph containing the talker and listener nodes from the roscpp_tutorials package, plus two additional nodes that collect CPU and memory usage statistics. Allow the nodes to run 60 seconds.
  • Launch the health_metric_collector ROS node using the launch file sample_application.launch as described above. That launch file also starts a cloudwatch_metrics_collector node, that forwards to the Amazon CloudWatch Metrics service each of the metric messages the health_metric_collector ROS node is publishing to the /metrics topic.
  • Allow the nodes to run for 180 seconds.
  • Terminate the health_metric_collector and cloudwatch_metrics_collector nodes, and allow the remaining nodes to run for 60 seconds.

The following graph shows the CPU usage during that scenario. After launching the nodes with sample_application.launch, the 1 minute average CPU usage increases from around 7% to a peak of 15%, and stabilizes around 6%, until the nodes are stopped around second 266.

cpu

The following graph shows the memory usage during that scenario. We start with a memory usage of 225 MB for the baseline graph, that increases to 251 MB (+11.56%) when sample_application.launch is launched. Memory usage keeps stable until we stop the nodes, and after tthat it goes back to 225 MB.

memory

Node

health_metric_collector

Published Topics

  • /metrics

Subscribed Topics

None

Services

None

CONTRIBUTING

Contributing Guidelines

Thank you for your interest in contributing to our project. Whether it’s a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.

Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn’t already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

  • A reproducible test case or series of steps
  • The version of our code being used
  • Any modifications you’ve made relevant to the bug
  • Anything unusual about your environment or deployment

Contributing via Pull Requests

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

  1. You are working against the latest source on the master branch.
  2. You check existing open, and recently merged, pull requests to make sure someone else hasn’t addressed the problem already.
  3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

  1. Fork the repository.
  2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  3. Ensure local tests pass.
  4. Commit to your fork using clear commit messages.
  5. Send us a pull request, answering any default questions in the pull request interface.
  6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on forking a repository and creating a pull request.

Finding contributions to work on

Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ‘help wanted’ issues is a great place to start.

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opensource-codeofconduct@amazon.com with any additional questions or comments.

Security issue notifications

If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public github issue.

Licensing

See the LICENSE file for our project’s licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a Contributor License Agreement (CLA) for larger changes.


Repository Summary

Checkout URI https://github.com/aws-robotics/health-metrics-collector-ros1.git
VCS Type git
VCS Version master
Last Updated 2022-02-08
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
health_metric_collector 2.0.2

README

health_metric_collector

Overview

This health_metric_collector ROS node collects system metrics and publishes them to /metrics topic. The cloudwatch_metrics_collector node is subscribed to this topic and will publish the metrics to AWS CloudWatch when it is instantiated.

Keywords: ROS, AWS, CloudWatch, Metrics

License

The source code is released under an Apache 2.0.

Author: AWS RoboMaker
Affiliation: Amazon Web Services (AWS)

RoboMaker cloud extensions rely on third-party software licensed under open-source licenses and are provided for demonstration purposes only. Incorporation or use of RoboMaker cloud extensions in connection with your production workloads or commercial product(s) or devices may affect your legal rights or obligations under the applicable open-source licenses. License information for this repository can be found here. AWS does not provide support for this cloud extension. You are solely responsible for how you configure, deploy, and maintain this cloud extension in your workloads or commercial product(s) or devices.

Supported ROS Distributions

  • Kinetic
  • Melodic

Installation

AWS Credentials

You will need to create an AWS Account and configure the credentials to be able to communicate with AWS services. You may find AWS Configuration and Credential Files helpful. Specifying AWS credentials by setting environment variables is not supported.

This node will require the following AWS account IAM role permissions:

  • cloudwatch:PutMetricData

Building from Source

To build from source you’ll need to create a new workspace, clone and checkout the latest release branch of this repository, install all the dependencies, and compile. If you need the latest development features you can clone from the master branch instead of the latest release branch. While we guarantee the release branches are stable, the master should be considered to have an unstable build due to ongoing development.

  • Install build tool: please refer to colcon installation guide

  • Create a ROS workspace and a source directory

      mkdir -p ~/ros-workspace/src
    
  • Clone the package into the source directory .

      cd ~/ros-workspace/src
      git clone https://github.com/aws-robotics/health-metrics-collector-ros1.git -b release-latest
    
  • Install dependencies

      cd ~/ros-workspace 
      sudo apt-get update && rosdep update
      rosdep install --from-paths src --ignore-src -r -y
    

Note: If building the master branch instead of a release branch you may need to also checkout and build the master branches of the packages this package depends on.

  • Build the packages

      cd ~/ros-workspace && colcon build
    
  • Configure ROS library Path

      source ~/ros-workspace/install/setup.bash
    
  • Build and run the unit tests

      colcon build --packages-select health_metric_collector --cmake-target tests
      colcon test --packages-select health_metric_collector && colcon test-result --all
    

Launch Files

An example launch file called sample_application.launch is included in this project that gives an example of how you can include this node in your project together with the cloudwatch_metrics_collector node.

Usage

Run the node

  • With launch file:
    • ROS: roslaunch health_metric_collector sample_application.launch
  • Without launch file using default values
    • ROS: rosrun health_metric_collector health_metric_collector

Running the sample application

To launch the sample application for the metrics node you can run the following command:

roslaunch health_metric_collector sample_application.launch --screen

Configuration file and Parameters

The health_metric_collector node receives an interval parameter that indicates the frequency in which it should sample metrics. e.g. interval=5 indicates sampling every five seconds. The default value is 5.

Supported Metrics Types

  • Free RAM (in MB)
  • Total RAM (in MB)
  • Total cpu usage (percentage)
  • Per core cpu usage (percentage)
  • Uptime (in sec)
  • Number of processes

Performance and Benchmark Results

We evaluated the performance of this node by runnning the followning scenario on a Raspberry Pi 3 Model B:

  • Launch a baseline graph containing the talker and listener nodes from the roscpp_tutorials package, plus two additional nodes that collect CPU and memory usage statistics. Allow the nodes to run 60 seconds.
  • Launch the health_metric_collector ROS node using the launch file sample_application.launch as described above. That launch file also starts a cloudwatch_metrics_collector node, that forwards to the Amazon CloudWatch Metrics service each of the metric messages the health_metric_collector ROS node is publishing to the /metrics topic.
  • Allow the nodes to run for 180 seconds.
  • Terminate the health_metric_collector and cloudwatch_metrics_collector nodes, and allow the remaining nodes to run for 60 seconds.

The following graph shows the CPU usage during that scenario. After launching the nodes with sample_application.launch, the 1 minute average CPU usage increases from around 7% to a peak of 15%, and stabilizes around 6%, until the nodes are stopped around second 266.

cpu

The following graph shows the memory usage during that scenario. We start with a memory usage of 225 MB for the baseline graph, that increases to 251 MB (+11.56%) when sample_application.launch is launched. Memory usage keeps stable until we stop the nodes, and after tthat it goes back to 225 MB.

memory

Node

health_metric_collector

Published Topics

  • /metrics

Subscribed Topics

None

Services

None

CONTRIBUTING

Contributing Guidelines

Thank you for your interest in contributing to our project. Whether it’s a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.

Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn’t already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

  • A reproducible test case or series of steps
  • The version of our code being used
  • Any modifications you’ve made relevant to the bug
  • Anything unusual about your environment or deployment

Contributing via Pull Requests

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

  1. You are working against the latest source on the master branch.
  2. You check existing open, and recently merged, pull requests to make sure someone else hasn’t addressed the problem already.
  3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

  1. Fork the repository.
  2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  3. Ensure local tests pass.
  4. Commit to your fork using clear commit messages.
  5. Send us a pull request, answering any default questions in the pull request interface.
  6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on forking a repository and creating a pull request.

Finding contributions to work on

Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ‘help wanted’ issues is a great place to start.

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opensource-codeofconduct@amazon.com with any additional questions or comments.

Security issue notifications

If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public github issue.

Licensing

See the LICENSE file for our project’s licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a Contributor License Agreement (CLA) for larger changes.