An option for clickhouse-client to show realtime table with metrics#63689
An option for clickhouse-client to show realtime table with metrics#63689alexey-milovidov merged 39 commits intoClickHouse:masterfrom
Conversation
|
This is an automated comment for commit 5387908 with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
32047d6 to
692d4fd
Compare
|
@mariaKhr Please take a look at my comments above |
|
This feature is amazing, I like it so much! I'm thinking about how to make it more visible. Maybe we should toggle the metrics display if a user presses some button, e.g., whitespace, during the query run? |
|
@jkartseva, there are two types of metrics: counters and gauges. |
|
But it does not work well for parallel replicas (or with distributed queries in general) - it looks like it does not aggregate across hosts. |
|
Let's display metrics documentation in a dark gray color at the rightmost column. |
|
Also, I'd improve color coding. For time-based metrics, less than 0.001 s/s will be dark gray, less than 0.01 gray, less than 0.1 green, less than 1 yellow, more than 1 bold (white if on dark background). The same for absolute values. For bytes-based metrics, less than 1 MB/s dark gray, less than 100 MB/sec. gray, less than 1 GB/sec green, less than 10 GB/sec yellow, 100 GB/sec orange, 1 TB/sec bold (white if on dark background). The same for absolute values. Metrics that were not updated in 5 seconds can be removed from the table. |
|
Change |
|
Absolute values without a multiplier should be shown without trailing zeros. Current: Should be: |
6cc6eac to
8b567d6
Compare
96db0c8 to
40e5a60
Compare
165fa40 to
1d3b7b0
Compare
d63b8f8 to
727f561
Compare
727f561 to
ce86bb1
Compare
ce86bb1 to
892f702
Compare
| ("stage", po::value<std::string>()->default_value("complete"), "Request query processing up to specified stage: complete,fetch_columns,with_mergeable_state,with_mergeable_state_after_aggregation,with_mergeable_state_after_aggregation_and_limit") | ||
| ("progress", po::value<ProgressOption>()->implicit_value(ProgressOption::TTY, "tty")->default_value(ProgressOption::DEFAULT, "default"), "Print progress of queries execution - to TTY: tty|on|1|true|yes; to STDERR non-interactive mode: err; OFF: off|0|false|no; DEFAULT - interactive to TTY, non-interactive is off") | ||
| ("progress-table", po::value<ProgressOption>()->implicit_value(ProgressOption::TTY, "tty")->default_value(ProgressOption::DEFAULT, "default"), "Print a progress table with changing metrics during query execution - to TTY: tty|on|1|true|yes; to STDERR non-interactive mode: err; OFF: off|0|false|no; DEFAULT - interactive to TTY, non-interactive is off.") | ||
| ("enable-progress-table-toggle", po::value<bool>()->default_value(true), "Enable toggling of the progress table by pressing the control key (Space). Only applicable in interactive mode with the progress table enabled.") |
There was a problem hiding this comment.
I enabled toggling by default, but there is a caveat:
If a client communicates with the server interactively, e.g., using expect program, the keystroke interceptor consumes the input and makes the communication impossible. In our .expect tests I explicitly disabled the --enable-progress-table-toggle option.
Perhaps, we should set this setting to false by default to be on the safe side. It may break clients that automate client interaction through expect-like programs.
There was a problem hiding this comment.
I'm totally ok with enabling it by default.
Expect scripts are a rare scenario. The interactive mode is not an API.
Follow-up on clickhouse-client realtime metrics display #63689
|
FWIW if the lines overlaps the terminal width it still flikers |
|
Also it is not strictly table metrics, but query, so how about renaming all options to reflect this? |
…eptor) Introduced in ClickHouse#63689, improved from 0.3 to 0.1 in ClickHouse#70423 with condvar. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>


Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
A new
--progress-tableoption in clickhouse-client prints a table with metrics changing during query execution; a new--enable-progress-table-toggleis associated with the--progress-tableoption, and toggles the rendering of the progress table by pressing the control key (Space).Documentation entry for user-facing changes
Modify your CI run
NOTE: If your merge the PR with modified CI you MUST KNOW what you are doing
NOTE: Checked options will be applied if set before CI RunConfig/PrepareRunConfig step
Include tests (required builds will be added automatically):
Exclude tests:
Extra options:
Only specified batches in multi-batch jobs:
Details