docker-stats

Crates.iodocker-stats
lib.rsdocker-stats
version0.1.1
sourcesrc
created_at2024-03-01 20:21:08.518323
updated_at2024-03-01 20:23:24.584396
descriptionVisualize container stats with beautiful, real-time charts directly in your terminal.
homepage
repositoryhttps://github.com/rafaelrcamargo/ds
max_upload_size
id1159212
size201,481
Rafael R. Camargo (rafaelrcamargo)

documentation

README

πŸ“Š 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.

Commit count: 0

cargo fmt