From 0fc36f662d06db8079ffea61a80b94e8d0e013ce Mon Sep 17 00:00:00 2001 From: Evgenik2 Date: Fri, 5 Dec 2025 18:04:29 +0300 Subject: [PATCH] Rename cluster state fetch to cluster diagnostics collect --- ydb/apps/ydb/CHANGELOG.md | 1 + ydb/public/lib/ydb_cli/commands/ya.make | 4 ++-- .../lib/ydb_cli/commands/ydb_cluster.cpp | 4 ++-- .../{ydb_state.cpp => ydb_diagnostics.cpp} | 18 +++++++++--------- .../{ydb_state.h => ydb_diagnostics.h} | 8 ++++---- 5 files changed, 18 insertions(+), 17 deletions(-) rename ydb/public/lib/ydb_cli/commands/{ydb_state.cpp => ydb_diagnostics.cpp} (89%) rename ydb/public/lib/ydb_cli/commands/{ydb_state.h => ydb_diagnostics.h} (69%) diff --git a/ydb/apps/ydb/CHANGELOG.md b/ydb/apps/ydb/CHANGELOG.md index d9cc95396f86..2705046838f3 100644 --- a/ydb/apps/ydb/CHANGELOG.md +++ b/ydb/apps/ydb/CHANGELOG.md @@ -1,3 +1,4 @@ +* The `ydb admin cluster state fetch` command was renamed to the `ydb admin cluster diagnostics collect`. * Added a new `--no-sanitize` option of the `ydb admin cluster state fetch` command. The new option disable sanitization and preserve sensitive data in the output. * Added `snapshot-ro` and `snapshot-rw` transaction modes to `--tx-mode` option of the `ydb table query execute` command. * Added `NO_COLOR` environment variable support to disable ANSI colors in YDB CLI (no-color.org) diff --git a/ydb/public/lib/ydb_cli/commands/ya.make b/ydb/public/lib/ydb_cli/commands/ya.make index 1108c37e7a70..ee76f9ccaa3a 100644 --- a/ydb/public/lib/ydb_cli/commands/ya.make +++ b/ydb/public/lib/ydb_cli/commands/ya.make @@ -15,6 +15,8 @@ SRCS( ydb_bridge.cpp ydb_cluster.cpp ydb_debug.cpp + ydb_diagnostics.cpp + ydb_diagnostics.h ydb_dynamic_config.cpp ydb_latency.cpp ydb_node_config.cpp @@ -31,8 +33,6 @@ SRCS( ydb_service_topic.cpp ydb_service_table.cpp ydb_sql.cpp - ydb_state.cpp - ydb_state.h ydb_storage_config.cpp ydb_tools_infer.cpp ydb_tools.cpp diff --git a/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp b/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp index 4f0710c295a2..18a2cc364a6d 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp @@ -1,7 +1,7 @@ #include "ydb_cluster.h" #include "ydb_bridge.h" -#include "ydb_state.h" +#include "ydb_diagnostics.h" #include "ydb_dynamic_config.h" #include @@ -23,7 +23,7 @@ TCommandCluster::TCommandCluster() AddCommand(std::make_unique()); AddCommand(std::make_unique()); AddCommand(std::make_unique(true)); - AddCommand(std::make_unique()); + AddCommand(std::make_unique()); } TCommandClusterBootstrap::TCommandClusterBootstrap() diff --git a/ydb/public/lib/ydb_cli/commands/ydb_state.cpp b/ydb/public/lib/ydb_cli/commands/ydb_diagnostics.cpp similarity index 89% rename from ydb/public/lib/ydb_cli/commands/ydb_state.cpp rename to ydb/public/lib/ydb_cli/commands/ydb_diagnostics.cpp index a6c3d25fa94b..b4bc477418f8 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_state.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_diagnostics.cpp @@ -1,4 +1,4 @@ -#include "ydb_state.h" +#include "ydb_diagnostics.h" #include #include @@ -11,20 +11,20 @@ namespace NYdb::NConsoleClient { -TCommandClusterState::TCommandClusterState() - : TClientCommandTree("state", {}, "Manage cluster internal state") +TCommandClusterDiagnostics::TCommandClusterDiagnostics() + : TClientCommandTree("diagnostics", {}, "Manage cluster internal state") { - AddCommand(std::make_unique()); + AddCommand(std::make_unique()); } -TCommandClusterStateFetch::TCommandClusterStateFetch() - : TYdbReadOnlyCommand("fetch", {}, +TCommandClusterDiagnosticsCollect::TCommandClusterDiagnosticsCollect() + : TYdbReadOnlyCommand("collect", {}, "Fetch aggregated cluster node state and metrics over a time period.\n" "Sends a cluster-wide request to collect state as a set of metrics from all nodes.\n" "One of the nodes gathers metrics from all others over the specified duration, then returns an aggregated result.") {} -void TCommandClusterStateFetch::Config(TConfig& config) { +void TCommandClusterDiagnosticsCollect::Config(TConfig& config) { TYdbReadOnlyCommand::Config(config); config.SetFreeArgsNum(0); config.Opts->AddLongOption("duration", @@ -47,7 +47,7 @@ void TCommandClusterStateFetch::Config(TConfig& config) { config.AllowEmptyDatabase = true; } -void TCommandClusterStateFetch::Parse(TConfig& config) { +void TCommandClusterDiagnosticsCollect::Parse(TConfig& config) { TYdbReadOnlyCommand::Parse(config); ParseOutputFormats(); } @@ -104,7 +104,7 @@ struct TARFile { } }; -int TCommandClusterStateFetch::Run(TConfig& config) { +int TCommandClusterDiagnosticsCollect::Run(TConfig& config) { NMonitoring::TMonitoringClient client(CreateDriver(config)); NMonitoring::TClusterStateSettings settings; settings.DurationSeconds(DurationSeconds); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_state.h b/ydb/public/lib/ydb_cli/commands/ydb_diagnostics.h similarity index 69% rename from ydb/public/lib/ydb_cli/commands/ydb_state.h rename to ydb/public/lib/ydb_cli/commands/ydb_diagnostics.h index a96c5cb67671..82f58f70d8f5 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_state.h +++ b/ydb/public/lib/ydb_cli/commands/ydb_diagnostics.h @@ -10,14 +10,14 @@ namespace NYdb::NConsoleClient { -class TCommandClusterState : public TClientCommandTree { +class TCommandClusterDiagnostics : public TClientCommandTree { public: - TCommandClusterState(); + TCommandClusterDiagnostics(); }; -class TCommandClusterStateFetch : public TYdbReadOnlyCommand, public TCommandWithOutput { +class TCommandClusterDiagnosticsCollect : public TYdbReadOnlyCommand, public TCommandWithOutput { public: - TCommandClusterStateFetch(); + TCommandClusterDiagnosticsCollect(); void Config(TConfig& config) override; void Parse(TConfig& config) override; int Run(TConfig& config) override;