Giter Club home page Giter Club logo

rotop's Introduction

rotop

About

top command for ROS 2

Features

  • Replace a long displayed name for ROS 2 command and Python command, especially for component container
    • ๐Ÿ˜ญ Normal top command : "component_container"
    • ๐Ÿ˜ญ Normal top -c or htop : "/very/long/path/component_container very-long-options"
    • ๐Ÿ˜„ My rotop command: "{node_name}, {name_space}"
  • Filter function
  • csv file logger
  • Graph plotter

How to use

pip3 install rotop

rotop
rotop --gui


# usage: rotop [-h] [--interval INTERVAL] [--filter FILTER] [--csv] [--gui] [--num_process NUM_PROCESS]
# options:
#   -h, --help            show this help message and exit
#   --interval INTERVAL
#   --filter FILTER
#   --csv
#   --gui
#   --num_process NUM_PROCESS
cd rotop
python3 main.py

Screen Shot

  • CUI mode
  • GUI mode

rotop's People

Contributors

iwatake2222 avatar sammyramone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rotop's Issues

Don't use `top` to get process status

Issue

  • Current implementation runs top command and parses the result
  • It may not work on environments other than Linux
  • Also, running top consumes CPU

Idea

  • Use psutil to get process status

rotop does not work on tmux with `init_extended_color() returned ERR` error

Thank you for the tool, it is very useful!!

But unfortunately rotop failed in some of my environment with the following message:

$ rotop
rotop version 0.1.4 by iwatake2222
Traceback (most recent call last):
  File "/home/minoda/.local/bin/rotop", line 8, in <module>
    sys.exit(main())
  File "/home/minoda/.local/lib/python3.10/site-packages/rotop/rotop.py", line 82, in main
    curses.wrapper(main_curses, args)
  File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/minoda/.local/lib/python3.10/site-packages/rotop/rotop.py", line 28, in main_curses
    curses.init_color(0, 0, 0, 0)
_curses.error: init_extended_color() returned ERR

After doing some quick research, it seems that the tmux is the cause here.

$ echo $TERM
tmux-256color

This is not critical since l can use this tool by exiting the tmux first and then executing it anyway, but since I was not sure how to fix it, would be glad if anyone could solve this issue. Thanks!

Feature request: Option to only show ROS node processes

First, thanks a lot for programming this helpful tool. I was looking for a small tool like this since some time, as it is very annoying to find out how much CPU load one node generates.
I think it would be great if there was an option like "--only-ros" which then only shows processes belonging to ROS nodes (and no other processes that are running, e.g. Firefox). I guess most people are actually just interested in these node processes and the long list of other processes makes the GUI less clear.

High CPU load using GUI

Running rotop without GUI is fine, however if I use the GUI, I get around 500% CPU load. Looks a bit like a busy waiting problem.
My system:
Ubuntu 22.04 running in WSL2
Python 3.10
rotop 1.0.0

top_runner.py: "object is not subscriptable" - Ubuntu 20.04.6 - ROS 2 Galactic

Using either

pip3 install rotop
...
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->pandas->rotop) (1.14.0)
ERROR: pandas 2.0.3 has requirement numpy>=1.20.3; python_version < "3.10", but you'll have numpy 1.17.4 which is incompatible.
...

rotop

or git clone and python3 main.py

Error:

Traceback (most recent call last):
  File "main.py", line 14, in <module>
    from src.rotop import main
  File "/home/ubuntu/wali_desk/systests/rotop/src/rotop/__init__.py", line 14, in <module>
    from . import data_container
  File "/home/ubuntu/wali_desk/systests/rotop/src/rotop/data_container.py", line 17, in <module>
    import pandas as pd
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev  # pyright: ignore # noqa:F401
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pandas/compat/__init__.py", line 16, in <module>
    from pandas._typing import F
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pandas/_typing.py", line 139, in <module>
    np.random.BitGenerator,
AttributeError: module 'numpy.random' has no attribute 'BitGenerator'

after pip3 install --upgrade numpy:

$ pip3 list | grep numpy
numpy                                1.24.4   

$ dpkg -l | grep ros-galactic-desktop
ii  ros-galactic-desktop                                0.9.3-2focal.20221208.082310 


$ python3 main.py 
Traceback (most recent call last):
  File "main.py", line 14, in <module>
    from src.rotop import main
  File "/home/ubuntu/wali_desk/systests/rotop/src/rotop/__init__.py", line 14, in <module>
    from . import data_container
  File "/home/ubuntu/wali_desk/systests/rotop/src/rotop/data_container.py", line 19, in <module>
    from .top_runner import TopRunner
  File "/home/ubuntu/wali_desk/systests/rotop/src/rotop/top_runner.py", line 25, in <module>
    class TopRunner:
  File "/home/ubuntu/wali_desk/systests/rotop/src/rotop/top_runner.py", line 120, in TopRunner
    def get_row_start_list(lines: list[str])->list[int]:
TypeError: 'type' object is not subscriptable

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.