Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ydb/apps/ydb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ydb/public/lib/ydb_cli/commands/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp
Original file line number Diff line number Diff line change
@@ -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 <ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/config/config.h>
Expand All @@ -23,7 +23,7 @@ TCommandCluster::TCommandCluster()
AddCommand(std::make_unique<TCommandClusterDump>());
AddCommand(std::make_unique<TCommandClusterRestore>());
AddCommand(std::make_unique<TCommandBridge>(true));
AddCommand(std::make_unique<TCommandClusterState>());
AddCommand(std::make_unique<TCommandClusterDiagnostics>());
}

TCommandClusterBootstrap::TCommandClusterBootstrap()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ydb_state.h"
#include "ydb_diagnostics.h"

#include <ydb/public/api/grpc/ydb_monitoring_v1.grpc.pb.h>
#include <ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/proto/accessor.h>
Expand All @@ -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<TCommandClusterStateFetch>());
AddCommand(std::make_unique<TCommandClusterDiagnosticsCollect>());
}

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",
Expand All @@ -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();
}
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading