Skip to content
forked from azat/chdig

Fork for testing stuff to avoid upstream pollution.

License

Notifications You must be signed in to change notification settings

azat-archive/chdig

 
 

Repository files navigation

chdig

Dig into ClickHouse with TUI interface.

Installation

There are pre-built packages for the latest available version:

Package repositories

archlinux user repository (aur)

And also for archlinux there is an aur package:

Note: chdig-latest-bin is recommended because it is latest available version and you don't need toolchain to compile

scoop (windows)

scoop bucket add extras
scoop install extras/chdig

brew (macos)

Right now official formula is not available yet, but you can use my tap for this:

brew tap azat-archive/chdig
brew install azat-archive/chdig/chdig

And also see releases as well.

Demo

asciicast

Motivation

The idea is came from everyday digging into various ClickHouse issues.

ClickHouse has a approximately universe of introspection tools, and it is easy to forget some of them. At first I came with some slides and a picture (to attract your attention) by analogy to what Brendan Gregg did for Linux:

Know Your ClickHouse

Note, the picture and the presentation had been made in the beginning of 2022, so it may not include some new introspection tools.

But this requires you to dig into lots of places, and even though during this process you will learn a lot, it does not solves the problem of forgetfulness. So I came up with this simple TUI interface that tries to make this process simpler.

chdig can be used not only to debug some problems, but also just as a regular introspection, like top for Linux.

See also FAQ

Features

  • top like interface (or csysdig to be more precise)
  • Flamegraphs (CPU/Real/Memory)
  • Cluster support (--cluster)

Views

  • Query view (system.processes)
  • Slow query log (system.query_log)
  • Last queries (system.query_log)
  • Processors (system.processors_profile_log)
  • Views (system.query_views_log)
  • Query logs (system.text_log)
  • Server logs (system.text_log)
  • Merges view (system.merges)
  • Mutations view (system.mutations)
  • Replicas (system.replicas)
  • Replication queue view (system.replication_queue)
  • Fetches (system.replicated_fetches)
  • Backups (system.backups)
  • Errors (system.errors)

And there is a huge bunch of TODOs (right now it is too huge to include it here).

Note, this it is in a pre-alpha stage, so everything can be changed (keyboard shortcuts, views, color schema and of course features)

Requirements

If something does not work, like you have too old version of ClickHouse, consider upgrading.

Later some backward compatiblity will be added as well.

Note: the oldest version that had been tested was 21.2

Build from sources

Prerequisites:

# will build deb/rpm/archlinux packages
make packages

Third party libraries

Third party services

Notes

Since Rust is a new language to me, the code can be far from ideal.

About

Fork for testing stuff to avoid upstream pollution.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 97.5%
  • Starlark 1.2%
  • Makefile 1.2%
  • Vim Script 0.1%