Skip to content

Commit d4f0c7d

Browse files
authored
Rename cluster state fetch to cluster diagnostics collect (#30227)
1 parent 2ddb163 commit d4f0c7d

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

ydb/apps/ydb/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* The `ydb admin cluster state fetch` command was renamed to the `ydb admin cluster diagnostics collect`.
12
* 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.
23
* Added `snapshot-ro` and `snapshot-rw` transaction modes to `--tx-mode` option of the `ydb table query execute` command.
34
* Added `NO_COLOR` environment variable support to disable ANSI colors in YDB CLI (no-color.org)

ydb/public/lib/ydb_cli/commands/ya.make

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ SRCS(
1515
ydb_bridge.cpp
1616
ydb_cluster.cpp
1717
ydb_debug.cpp
18+
ydb_diagnostics.cpp
19+
ydb_diagnostics.h
1820
ydb_dynamic_config.cpp
1921
ydb_latency.cpp
2022
ydb_node_config.cpp
@@ -31,8 +33,6 @@ SRCS(
3133
ydb_service_topic.cpp
3234
ydb_service_table.cpp
3335
ydb_sql.cpp
34-
ydb_state.cpp
35-
ydb_state.h
3636
ydb_storage_config.cpp
3737
ydb_tools_infer.cpp
3838
ydb_tools.cpp

ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "ydb_cluster.h"
22

33
#include "ydb_bridge.h"
4-
#include "ydb_state.h"
4+
#include "ydb_diagnostics.h"
55
#include "ydb_dynamic_config.h"
66

77
#include <ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/config/config.h>
@@ -23,7 +23,7 @@ TCommandCluster::TCommandCluster()
2323
AddCommand(std::make_unique<TCommandClusterDump>());
2424
AddCommand(std::make_unique<TCommandClusterRestore>());
2525
AddCommand(std::make_unique<TCommandBridge>(true));
26-
AddCommand(std::make_unique<TCommandClusterState>());
26+
AddCommand(std::make_unique<TCommandClusterDiagnostics>());
2727
}
2828

2929
TCommandClusterBootstrap::TCommandClusterBootstrap()

ydb/public/lib/ydb_cli/commands/ydb_state.cpp renamed to ydb/public/lib/ydb_cli/commands/ydb_diagnostics.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "ydb_state.h"
1+
#include "ydb_diagnostics.h"
22

33
#include <ydb/public/api/grpc/ydb_monitoring_v1.grpc.pb.h>
44
#include <ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/proto/accessor.h>
@@ -11,20 +11,20 @@
1111

1212
namespace NYdb::NConsoleClient {
1313

14-
TCommandClusterState::TCommandClusterState()
15-
: TClientCommandTree("state", {}, "Manage cluster internal state")
14+
TCommandClusterDiagnostics::TCommandClusterDiagnostics()
15+
: TClientCommandTree("diagnostics", {}, "Manage cluster internal state")
1616
{
17-
AddCommand(std::make_unique<TCommandClusterStateFetch>());
17+
AddCommand(std::make_unique<TCommandClusterDiagnosticsCollect>());
1818
}
1919

20-
TCommandClusterStateFetch::TCommandClusterStateFetch()
21-
: TYdbReadOnlyCommand("fetch", {},
20+
TCommandClusterDiagnosticsCollect::TCommandClusterDiagnosticsCollect()
21+
: TYdbReadOnlyCommand("collect", {},
2222
"Fetch aggregated cluster node state and metrics over a time period.\n"
2323
"Sends a cluster-wide request to collect state as a set of metrics from all nodes.\n"
2424
"One of the nodes gathers metrics from all others over the specified duration, then returns an aggregated result.")
2525
{}
2626

27-
void TCommandClusterStateFetch::Config(TConfig& config) {
27+
void TCommandClusterDiagnosticsCollect::Config(TConfig& config) {
2828
TYdbReadOnlyCommand::Config(config);
2929
config.SetFreeArgsNum(0);
3030
config.Opts->AddLongOption("duration",
@@ -47,7 +47,7 @@ void TCommandClusterStateFetch::Config(TConfig& config) {
4747
config.AllowEmptyDatabase = true;
4848
}
4949

50-
void TCommandClusterStateFetch::Parse(TConfig& config) {
50+
void TCommandClusterDiagnosticsCollect::Parse(TConfig& config) {
5151
TYdbReadOnlyCommand::Parse(config);
5252
ParseOutputFormats();
5353
}
@@ -104,7 +104,7 @@ struct TARFile {
104104
}
105105
};
106106

107-
int TCommandClusterStateFetch::Run(TConfig& config) {
107+
int TCommandClusterDiagnosticsCollect::Run(TConfig& config) {
108108
NMonitoring::TMonitoringClient client(CreateDriver(config));
109109
NMonitoring::TClusterStateSettings settings;
110110
settings.DurationSeconds(DurationSeconds);

ydb/public/lib/ydb_cli/commands/ydb_state.h renamed to ydb/public/lib/ydb_cli/commands/ydb_diagnostics.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
namespace NYdb::NConsoleClient {
1212

13-
class TCommandClusterState : public TClientCommandTree {
13+
class TCommandClusterDiagnostics : public TClientCommandTree {
1414
public:
15-
TCommandClusterState();
15+
TCommandClusterDiagnostics();
1616
};
1717

18-
class TCommandClusterStateFetch : public TYdbReadOnlyCommand, public TCommandWithOutput {
18+
class TCommandClusterDiagnosticsCollect : public TYdbReadOnlyCommand, public TCommandWithOutput {
1919
public:
20-
TCommandClusterStateFetch();
20+
TCommandClusterDiagnosticsCollect();
2121
void Config(TConfig& config) override;
2222
void Parse(TConfig& config) override;
2323
int Run(TConfig& config) override;

0 commit comments

Comments
 (0)