Giter Club home page Giter Club logo

caret_report's Introduction

Scripts to create analysis reports using CARET trace data

Open a sample report page

What is created with this repo?

  • Input:
    • CARET trace data (CTF file)
  • Output (html pages):

Requirements

  • Ubuntu 20.04
  • ROS2 Galactic
  • CARET
  • The followings
# Flask 2.1.0 (need to specify version) is required to create html report pages
pip3 install Flask==2.1.0

# firefox, selenium and geckodriver are required to generate graph image files
sudo apt install -y firefox
pip3 install selenium
wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
tar xzvf geckodriver-v0.31.0-linux64.tar.gz
mv geckodriver /usr/local/bin/.

Note

  • It uses lots of memory
    • 64GB or more is recommended
    • In case crash happens due to memory shortage, increase swap space

Sample

Please refer to sample_autoware to find quick usage

How to use

  • Run the following commands
    • Make sure to modify settings for your usage and environment
    • Make sure to prepare JSON files
  • report_{dir_name_of_trace_data} is created
  • Open index.html to see a report
# Settings: modify for your usage and environment
export script_path=./CARET_report                   # Path to this repo cloned
export package_list_json=./package_list.json        # Path to setting file you prepare
export target_path_json=./target_path.json          # Path to setting file you prepare
export trace_data=~/.ros/tracing/caret_sample/      # Path to CARET trace data (CTF file)
export start_time=0                                 # start time[sec] for analysis
export duration_time=9999                           # duration time[sec] for analysis
export max_node_depth=20                            # The number of depth to search path
export draw_all_message_flow=false                  # Flag to a create message flow graph for a whole time period (this will increase report creation time)

# Run script
sh ${script_path}/make_report.sh

Setting JSON files

package_list.json

  • Node analysis report will be created for each package_name
  • Settings
    • package_list_json : path to the JSON file
  • Please describe the following information
    • Package name information (package_dict)
      • Pairs of package_name and regular expression for nodes belonging to the package
    • Ignore node list (ignore_list)
      • List of Regular expression for nodes to be ignored
{
    "package_dict": {
        "Package_A" : "^/package_a",
        "Package_B" : "^/package_b",
    },
    "ignore_list": [
        "noisy_node_name_a",
        "^/annoying_package_name",
    ]
}

target_path.json

  • Path analysis report will show results for pathes described in this JSON file
  • Settings
    • target_path_json : path to the JSON file
    • max_node_depth : In case a target path is not found, increase the number. In case the script stuck, descrease the number
  • Please describe the following information
    • Pair of name and path
    • path is a list of node_name (note: path doean't mean path as filesystem!)
      • Regular expression is supported
      • You can also set [node_name, topic_name] instead of node_name . It is useful when two nodes are connected via multiple topics
[
    {
        "name": "path_name",
        "path": [
            "The first node_name in the path",
            "The second node_name in the path",
            ["The third node_name in the path", "The topic name published by the third node"]
            "...",
            "The last node_name in the path",
        ]
    }
    {
        "name": "sample_path",
        "path": [
            "/package_a/node_1",
            "/package_a/node_2",
            ["/package_a/node_3", "/topic_3"],
            "/package_a/node_4_.*"
        ]
    },
]

Tips

Easy way to create target_path.json

  • Install Dear RosNodeViewer
  • Open graph ( e.g.: dear_ros_node_viewer architecture.yaml )
  • Select nodes in the path which you want to analyze
    • ctrl + click
  • Press C to export node name list to clip board
  • Paste the exported node name list to json file

Why regular expression is helpful?

  • In case a node name varies for each execution, you can write node name in JSON like the following
    • Before: /node_name_xyz_abc1234567_1234567_1234567891234567891
    • After: /node_name_xyz.*

caret_report's People

Contributors

takeshi-iwanari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.