Skip to main content

cstat

A visual stat tool for CrateDB clusters.

cstat is ispired by the awesome interactive process monitoring tool htop. cstat should be a similar tool to iostat, but for monitoring CrateDB clusters.

Screenshot of cstat in action

Requirements

cstat requires Python >= 3.6 and can connect to CrateDB >= 2.3.

Installation

cstat is available from Pypi so you can install it using pip.

pip install cstat

If you want to get the latest features and fixes, you can also install it directly from Github.

pip install git+https://github.com/chaudum/crate-top.git@master

Usage

After installation you can monitor CrateDB running on localhost with default configuration by invoking the following command:

>>> cstat --user crate

A full list of command line arguments are listed when invoking cstat with the --help argument:

>>> cstat --help
usage: cstat [-h] [--host HOST] [--port PORT] [--interval INTERVAL]
             [--user USER] [--version]

A visual stat tool for CrateDB clusters

optional arguments:
  -h, --help            show this help message and exit
  --host HOST, --crate-host HOST
                        CrateDB host to connect to
  --port PORT, --psql-port PORT
                        PSQL port of CrateDB host
  --interval INTERVAL, --refresh-interval INTERVAL
                        amount of time in seconds between each update
  --user USER, --db-user USER
                        database user
  --version             show program's version number and exit

By default cstat connects to localhost on port 5432 if not otherwise specified.

Keyboard Shortcuts

  • 0 … toggle cluster info

  • 1 … show utilization for CPU, process, memory, heap and disk

  • 2 … show I/O statistics for network and disk

  • 3 … show aggregated query duration based on jobs_log

  • x … toggle nodes/aggregation view

  • f3 … enable/disable job logging (this also sets the stats.jobs_log cluster setting)

Known Issues

  • Small terminal sizes will raise CanvasErrors because of content overflow.

Todo

  • [x] display disk usage

  • [x] display disk i/o

  • [x] display network i/o

  • [x] display node names in detail views

  • [x] use asyncio to perform http requests

  • [x] coloring of i/o stats

  • [ ] responsive i/o widget

Changelog for cstat

Unreleased

0.3.0

Released on 2018/06/01 with the following changes:

  • Make cstat compatible with CrateDB version 2.3.0 and greater.

    • Updated process CPU usage calculation to work with CrateDB 2.3 and newer.

    • Updated disk usage and disk i/o calculation to work with CrateDB 2.3 and newer.

  • Added -V (prompt for username) argument.

  • Added --password and -W (prompt for password) arguments.

0.2.0

Released on 2017/11/14 with the following changes:

  • Implemented asynchronous database access using aiopg which uses the Postgres Wire Protocol instead of the official CrateDB Python client which uses the HTTP protocol.

  • Added median, percentile 95, and percentile 99 to query stats table view.

  • Added --user/--db-user command line argument to support user authentication for clusters which run CrateDB 2.0 or greater.

  • Changed the toggle key for enabling/disabling query stats from F1 to F3, because in the Terminator terminal the F1 key is reserved for “help”.

  • Pre-calculate used and idle CPU in SQL statement to avoid rounding issues that can cause an display overflow in CPU widget.

0.1.0

Initial release on 2017/03/30:

Release files for cstat 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cstat 3.0.0
File Size Uploaded
cstat-3.0.0.tar.gz 61.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cstat 3.0.0
File Interpreter ABI Platform
cstat-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 80.7 kB

Release files / cstat-3.0.0.tar.gz

Download URL cstat-3.0.0.tar.gz
Size 61.4 kB
Tags Source
SHA-256 checksum
How to use checksums
73121d9e5e20c43e70740a435da0c208b1adebeb10eb3ec6e3a87167e99cf09f
BLAKE2b-256 checksum
How to use checksums
26271b04cc76a3fea5bc2c689420f4712add445614dda786c748e1cca4e82d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / cstat-3.0.0-py3-none-any.whl

Download URL cstat-3.0.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9a52be9465c54abc3f505def253a5fbe055f2e1d2f8ed12b97008f2c0fa426b
BLAKE2b-256 checksum
How to use checksums
aa81b08067e78d3b4cc8a4bd20dc6e7c0e608803441afee053415415c225eb47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

0.2.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page