Display ZFS datasets' I/O in real time

Related tags

Command-line ztop
Overview

ztop

Display ZFS datasets' I/O in real time

Build Status Crates.io

Overview

ztop is like top, but for ZFS datasets. It displays the real-time activity for datasets. The built-in zpool iostat can display real-time I/O statistics for pools, but until now there was no similar tool for datasets.

Platform support

ztop works on FreeBSD 12 and later. It would probably work on Linux with minor modifications. Patches welcome.

Screenshot

Screenshot 1

Minimum Supported Rust Version (MSRV)

ztop is supported on Rust 1.53.0 and higher. It's MSRV will not be changed in the future without bumping the major or minor version.

License

ztop is primarily distributed under the terms of the BSD 2-clause license.

See LICENSE for details.

Sponsorship

ztop is sponsored by Axcient, inc.

Comments
  • Define a better MSRV policy

    Define a better MSRV policy

    Ztop's current MSRV policy is basically "The oldest possible, and never raise it without considering it a breaking change". That's a reasonable policy for a library crate, but not for a binary crate. Instead, since Ztop's consumers are OS package managers, Ztop should define its MSRV to be the oldest Rust compiler in any supported OS. Currently, that's:

    • 1.55.0 for FreeBSD. https://www.freshports.org/lang/rust/

    But if we gain Linux support, we should track a few others. @guygastineau what should ztop assume about the lowest Rust version in common Linux distros?

    opened by asomers 2
  • Formatting

    Formatting

    I wonder if you want cargo fmt used on the codebase? There are substantial modifications to some files when used. If you want it I will make a PR just for formatting, and I will then cargo fmt any work that I push elsewhere. If you don't want to enforce formatting then I will just try to use sensible conventions that fit with your style in my work without running the tool.

    opened by guygastineau 2
  • Eliminate annoying warnings on the latest FreeBSD head

    Eliminate annoying warnings on the latest FreeBSD head

    • Don't print warnings about unknown stats in a release build
    • Don't print warnings about the new zil stats, for example "zil_itx_count", in the most recent FreeBSD head.

    Sponsored by: Axcient

    opened by asomers 0
  • Don't crash if the unlinked and unlinks sysctls aren't present.

    Don't crash if the unlinked and unlinks sysctls aren't present.

    On FreeBSD 12.2, they aren't. Also, improve the OS-specific tests:

    • More modularity
    • Don't require the zfs kmod to be loaded during the tests
    • Test using canned data from both FreeBSD 12.2 and 13.0.

    Fixes #4

    opened by asomers 0
  • Panic at src/app/freebsd.rs:53 on FreeBSD 12

    Panic at src/app/freebsd.rs:53 on FreeBSD 12

    On FreeBSD 12, ztop panics like this:

    thread 'main' panicked at 'assertion failed: `(left == right)`
      left: `"objset-0xe751ca"`,
     right: `"objset-0x402343"`', src/app/freebsd.rs:53:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    The cause is the lack of nunlinked and nunlinks fields in FreeBSD 12's ZFS dataset stats. Shouldn't be too hard to fix.

    opened by asomers-ax 0
  • Benchmarks for the backend

    Benchmarks for the backend

    I spent a little time this evening to explore benchmarks for the backend, but this being a binary only crate I cannot figure out how to call any code from the linux module outside of the binary crate itself :/

    Originally posted by @guygastineau in https://github.com/asomers/ztop/issues/13#issuecomment-957069977

    opened by asomers 2
  • ZoL

    ZoL

    Once I stopped resisting the architecture and pretending Rust is Haskell the solution just fell into place ;)

    I should implement tests. Luckily, we can test with a mock procfs! Preliminarily I have run it with cargo run on my machine and the outputs were sensible given the workloads I was running. It was strange that I didn't see any activity when I did a ZFS send, but it might have been cached already from using rsync before the send.

    It is outside the scope of this PR, but by conditionally supplying the zfs_stats_path this code should work on BSD too. Once this PR is finished and merged I will investigate on my FreeBSD machine. It seems like a lot of complexity can be removed (sorry off topic).

    I'll need to merge the cargo fmt commits into this (I haven't run it on the code base yet anyway). I also need to run clippy.

    Closes #9

    PS. I can rebase a couple commits out where I was trying to do this the wrong way.

    opened by guygastineau 22
  • Linux support

    Linux support

    I wish I was smart enough to actually fix and submit a patch, but the best I can do is show you errors.

       Compiling ztop v0.1.1 (/home/fryfrog/git/ztop)
    error[E0433]: failed to resolve: use of undeclared type `SnapshotIter`
      --> src/app.rs:68:9
       |
    68 |         SnapshotIter::new(pool)
       |         ^^^^^^^^^^^^ use of undeclared type `SnapshotIter`
    
    error[E0412]: cannot find type `SnapshotIter` in this scope
      --> src/app.rs:67:47
       |
    28 | struct Snapshot {
       | --------------- similarly named struct `Snapshot` defined here
    ...
    67 |     pub fn iter(pool: Option<&str>) -> Result<SnapshotIter, Box<dyn Error>> {
       |                                               ^^^^^^^^^^^^
       |
    help: a struct with a similar name exists
       |
    67 |     pub fn iter(pool: Option<&str>) -> Result<Snapshot, Box<dyn Error>> {
       |                                               ^^^^^^^^
    help: you might be missing a type parameter
       |
    38 | impl<SnapshotIter> Snapshot {
       |     ^^^^^^^^^^^^^^
    
    error[E0599]: no associated item named `CLOCK_UPTIME` found for struct `nix::time::ClockId` in the current scope
       --> src/app.rs:111:51
        |
    111 |             let boottime = clock_gettime(ClockId::CLOCK_UPTIME).unwrap();
        |                                                   ^^^^^^^^^^^^
        |                                                   |
        |                                                   associated item not found in `nix::time::ClockId`
        |                                                   help: there is an associated constant with a similar name: `CLOCK_BOOTTIME`
    
    Some errors have detailed explanations: E0412, E0433, E0599.
    For more information about an error, try `rustc --explain E0412`.
    

    Feel free to just close if you don't want this sort of not very helpful help. :)

    enhancement 
    opened by fryfrog 13
Owner
Alan Somers
Alan Somers
Rust code for T-Display S3 AMOLED, ESP32-S3 board with RM67162 AMOLED display

T-Display S3 AMOLED What is it? This is a Rust BSP for the Lilygo's T-Display S3 AMOLED board. RM67162 AMOLED driver in QSPI mode RM67162 AMOLED drive

BH1XUW 4 Jun 28, 2023
httm prints the size, date and corresponding locations of available unique versions of files residing on ZFS snapshots

httm prints the size, date and corresponding locations of available unique versions of files residing on ZFS snapshots, as well as allowing their interactive viewing and restoration.

null 837 Dec 30, 2022
Real-time CLI level meter built in Rust.

Meter This is a very simple command line utility written in Rust for measuring the gain of a microphone. It displays the values in dBFS. This is usefu

Chris Burgess 16 Sep 8, 2022
An experimental real-time operating system (RTOS) written in Rust

An experimental real-time operating system (RTOS) written in Rust

null 0 Nov 14, 2022
Real-time stock tickers from the command-line. Written in Rust.

ticker-rs Real-time stock tickers from the command-line written in Rust. CLI tool using the Yahoo Finance API as a data source. It features colored ou

Patrick Stadler 4 Nov 17, 2022
Minimal and blazing-fast file server. For real, this time.

Zy Minimal and blazing-fast file server. For real, this time. Features Single Page Application support Partial responses (Range support) Cross-Origin

Miraculous Owonubi 17 Dec 18, 2022
🛡️ Terminal-based, real-time traffic monitoring and statistics for your AdGuard Home instance

AdGuardian-Term Terminal-based, real-time traffic monitoring and statistics for your AdGuard Home instance About AdGuardian Terminal Eddition - Keep a

Alicia Sykes 629 Jun 14, 2023
Revolutionize handheld gaming with adaptive game settings. Optimize graphics and gameplay experience based on real-time system metrics. Open-source project empowering developers to enhance games on portable devices

Welcome to the server-side application for the HarmonyLink project. This innovative software is developed with the Rust programming language and is ai

Jordon Brooks 5 Jun 28, 2023
Kiomet.com real-time strategy game

Kiomet.com Kiomet.com is an online multiplayer real-time strategy game. Command your forces wisely and prepare for intense battles! Build Instructions

Softbear 26 Oct 10, 2023
A universal load testing framework for Rust, with real-time tui support.

rlt A Rust Load Testing framework with real-time tui support. rlt provides a simple way to create load test tools in Rust. It is designed to be a univ

Wenxuan 129 Jul 20, 2024
Blaze is a Rust script that continuously monitors server resource usage and sends real-time summaries and alerts to a Discord channel via Webhook.

Blaze Blaze is a Rust script designed to run 24/7 on a server, providing a summary of resource usage every 30 minutes (configurable) to a Discord chan

ShadowArcanist 18 Sep 23, 2024
belt is a command line app that can show your time from a list of selected time zones

A CLI app to show your time from a list of selected time zones, and a rust lib to parse dates in string formats that are commonly used.

Rollie Ma 23 Nov 4, 2022
Deadliner helps you keep track of the time left for your deadline by dynamically updating the wallpaper of your desktop with the time left.

Deadliner Watch the YouTube video What's Deadliner? Deadliner is a cross-platform desktop application for setting deadline for a project and keeping t

Deadliner 34 Dec 16, 2022
Helps you keep track of time for team members across different time zones & DST changes

Teamdate Helps you keep track of time for team members across different timezones and other daylight saving changes based off their location. Because

Alex Snaps 7 Jan 9, 2023
CLI app to display list of trending anime, music charts or recommend anime to watch or song to listen to.

Description Anitrendz is a cli app that uses data from the anitiop api to list the top anime and songs or recommend a random anime to watch or song to

Jimmy 9 Jun 11, 2022
Display financial Data on The Terminal

tuinance Tuinance is a performant TUI program to display financial data, written completely in Rust. All data is gathered through the Yahoo Finance AP

Juho 10 May 31, 2022
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use • How Does It

null 17 Sep 25, 2022
Rust command line utility to quickly display useful secrets in a Kubernetes namespace

kube-secrets This is a command line utility for quickly looking at secrets in a Kubernetes namespace that are typically looked at by humans. It specif

Frank Wiles 8 Feb 10, 2022
Display candlestick chart in your terminal.

cli-candlestick-chart This module allows you to display candle charts directly in your terminal. I did this project mainly to learn Rust, so the code

Julien 178 Dec 18, 2022