#docker #container #stats #monitoring #terminal

app docker-stats

Visualize container stats with beautiful, real-time charts directly in your terminal

2 releases

0.1.1 Mar 1, 2024
0.1.0 Mar 1, 2024

#2224 in Command line utilities

Apache-2.0

160KB
258 lines

πŸ“Š ds - Real-time Stats with Terminal Charts

Visualize container stats with beautiful, real-time charts directly in your terminal.

demo

[!IMPORTANT] This is a WIP, main should be stable, but keep in mind this is changing constantly. Thanks! :)

Why ds?

  • Missing Charts: While experimenting with OrbStack, a lightweight Docker container management tool, I found that it lacks the visual charts that Docker Desktop provides. This project aims to bridge that gap.
  • Visual Analysis: Visualizing system stats in real-time can help spot issues that might go unnoticed in text-based outputs. ds brings colors and moving charts to your system analysis.
  • Rust-Powered πŸ˜Άβ€πŸŒ«οΈ: This project is written in Rust, leveraging its performance and reliability.

Installation

[!NOTE] There's a "beta" version of this tool available on crates.io. You can install it with cargo install ds.

Source

Ensure you have Cargo installed. Then, clone this repo:

git clone https://github.com/rafaelrcamargo/ds

Development

Then just cd into the directory and run:

cargo run -- <ARGS> # For development

Release

In the project directory, run:

cargo run --release -- <ARGS> # For production

Then add this command to your $PATH, you can run:

# May require sudo
mv target/release/ds /usr/local/bin

Usage

To use it with the default settings, just run:

ds

This is akin to docker stats.

For more options, you can run:

ds -h

Examples & Use Cases

Some examples of how you can use this tool.

Compact view for all containers

For a basic overview of all containers in a space-saving format:

ds -c

Full view for some containers

To see detailed stats for a specific container, including NET and IO charts:

ds -f 5f03524a8fbe api-1

Roadmap

Pain Points

Some things that are bad, but expected.

Painfully slow to start

I know... It is slow to start, but that's it. This is the time docker stats takes to run, it has to hook up to the container and get the realtime stats. As for today I have tested it with OrbStack and Docker Desktop, the delay seems to be the same, but I'll keep looking into it.

network_mode: host

From the GIF you can also note that the NET chart is not moving, but this is expected there. This containers are running in network_mode: host and the NET chart will only be populated if you're using the bridge network.

Ps: If you use Mac and think I'm completely out of my mind for the network_mode: host above, I know. It's a running topic on the Docker Desktop for Mac and yet not supported. You can follow the discussion here. And this was the main reason I started looking into OrbStack.

License

This project is licensed under the Apache License 2.0.

Dependencies

~3–16MB
~171K SLoC