It's like "docker stats" but with beautiful, real-time charts into your terminal. πŸ“Š

Overview

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

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

demo

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
I plan to publish ds on crates.io once it's stable enough.

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

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.

You might also like...
First iteration of gluing our modules together into a PoA private network

First iteration of gluing our modules together into a PoA private network

Library + CLI-Tool to measure the TTFB (time to first byte) of HTTP requests. Additionally, this crate measures the times of DNS lookup, TCP connect and TLS handshake.

TTFB: CLI + Lib to Measure the TTFB of HTTP/1.1 Requests Similar to the network tab in Google Chrome or Mozilla Firefox, this crate helps you find the

A SOAP client for Brazilian Central Bank's Time Series Management System

A SOAP client for Brazilian Central Bank's Time Series Management System

Easily share data between terminal windows!
Easily share data between terminal windows!

abra A tool that makes data sharing between terminal windows easy. abra can be used for displaying info about the current working directory, for split

πŸ€– brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers

brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers (plain text data). That is, although it can be accessed from a browser, brwrs will not correctly interpret the browser's GET request.

Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code...

tosh Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code... Inspired fro

A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address.
A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address.

innisfree A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address. Why? Most of the data I maintain is local,

Obtain (wildcard) certificates from let's encrypt using dns-01 without the need for API access to your DNS provider.

Agnos Presentation Agnos is a single-binary program allowing you to easily obtain certificates (including wildcards) from Let's Encrypt using DNS-01 c

Automatically updates your Cloudflare DNS records for specific zones. Especially useful if you have dynamic IP address

Cloudflare DNS updater What does it do? Cloudflare DNS updater updates specified dns records for specified zones effortlessly and automatically. It wa

Comments
  • Fix container deletion when it is deleted or shut down

    Fix container deletion when it is deleted or shut down

    Description: Find a way to identify when a containers ceased it's existance

    Steps to Reproduce:

    1. Compose some containers
    2. Run ds
    3. Compose down those containers

    Expected Behavior: No containers left on the screen.

    Actual Behavior: Some containers are deleted but the remainder one's, the ones that never got any new lines after never receive the "signal" to print. The docker stats never tells you when something is destroyed, it just disappears witch is hard to identify on a stream, when it's lag or common delay & when it really should be excluded.

    Screenshots/Logs: Nah.

    Environment:

    • Rust version: 1.73.0-nightly
    • Operating System: macOS
    • CLI version (if applicable): Not yet.
    bug enhancement help wanted good first issue hacktoberfest 
    opened by rafaelrcamargo 1
  • Use cursor movement to avoid spamming the terminal with new lines

    Use cursor movement to avoid spamming the terminal with new lines

    Description: In the current implementation ds uses simply a println! to update the terminal charts, but this causes a horrible experience when you scroll up, so you stop "following" the new updates, also it completely overwrites anything on your terminal history flooding with new lines and old charts.

    Use Case: Yes...

    Proposed Solution: Reading more about it I found about Cursor Movement, those enable you to keep "reusing" and rewriting lines since you can now keep track of'em using the ANSI escape sequences \033[s and \033[u to save and restore the cursor position, this creates a issue, you'll rewrite the chars used, but if the past line had more content than the new one the rest will be present, for that also exists a ANSI escape sequence \033[K witch cleans to the end of the actual line. So with something like:

    # Save the cursor position
    printf "\033[s"
    
    # Clean and print the argument
    cap() { printf "\033[K$1\n"; }
    
    for i in {1..5}; do
      # Restore the cursor position
      printf "\033[u"
    
      cap "foo ${i}"
      cap "bar ${i}"
    
      sleep 0.05
    done
    
    # Restore the cursor position
    printf "\033[u"
    
    cap "Heyy"
    cap "Yoo"
    

    We can have a set of fixed lines being updated witch solves, or at least I think will solve the issues in the description.

    Additional Context: Nope.

    enhancement good first issue hacktoberfest 
    opened by rafaelrcamargo 1
  • Refactor: instant-based container purging

    Refactor: instant-based container purging

    This closes #5 for now, after a series of tests I described on the issue this seems like a reasonable and simple enough solution to break in the final product.

    enhancement 
    opened by rafaelrcamargo 0
Owner
Rafael R. Camargo
Web Developer and Student. [React, ..Rust]
Rafael R. Camargo
IDP2P is a peer-to-peer identity protocol which enables a controller to create, manage and share its own proofs as well as did documents

IDP2P Experimental, inspired by ipfs, did:peer and keri Background See also (related topics): Decentralized Identifiers (DIDs) Verifiable Credentials

null 5 Oct 31, 2022
This Intelligent Transportation Systems (ITS) MQTT client based on the JSon ETSI specification transcription provides a ready to connect project for the mobility

This Intelligent Transportation Systems (ITS) MQTT client based on the JSon ETSI specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...). Let's connect your device or application to our Intelligent Transport Systems (ITS) platform!

Orange 4 Nov 29, 2022
Convert your docker-compose into excalidraw

excalidocker-rs Rust-based utility to convert docker-compose.yaml files into excalidraw files. Key features Transform your local docker-compose files

Eugene Tolbakov 26 Jun 15, 2023
The classic game of Pong, in your terminal, over ICMPv6!

icmpong The classic game of Pong, in your terminal, over ICMPv6! icmpong.mov How does this work? We are basically "using the ping command to send data

Ryan 3 Nov 9, 2023
RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust

RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust

Cris Liao 16 Dec 4, 2022
Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password.

nostr-irc Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password. Experimental code, use

null 11 Dec 26, 2022
A Curve-like AMM for Secret Network

A Curve-like AMM for Secret Network. Supports a varibale number of tokens with the same underlying value.

Enigma 16 Dec 11, 2022
A tcp port forwarding system like ngrok.

Pruxy A tcp port forwarding system like ngrok. Todo http request handler agent <-> server connection agent How to use Generate cert files mkdir ssl_ce

null 1 Jan 24, 2022
Transforms UDP stream into (fake) TCP streams that can go through Layer 3 & Layer 4 (NAPT) firewalls/NATs.

Phantun A lightweight and fast UDP to TCP obfuscator. Table of Contents Phantun Latest release Overview Usage 1. Enable Kernel IP forwarding 2. Add re

Datong Sun 782 Dec 30, 2022
A rough transliteration of ls and grep from Toybox into Rust

Toybox to Rust (transliteration) A rough port of ls and grep from Toybox by trying to follow the original structure of the C code. Building Your syste

null 0 Dec 25, 2021