Skip to content

Commit b3b50ef

Browse files
committed
Simplify workload topic init
1 parent 82ba66e commit b3b50ef

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ TString TTopicOperationsScenario::GetWriteOnlyTableName() const
5454
return TableName;
5555
}
5656

57+
ui32 TTopicOperationsScenario::GetTopicMaxPartitionCount() const
58+
{
59+
return TopicMaxPartitionCount >= TopicPartitionCount ? TopicMaxPartitionCount : (TopicPartitionCount << 3);
60+
}
61+
5762
THolder<TLogBackend> TTopicOperationsScenario::MakeLogBackend(TConfig::EVerbosityLevel level)
5863
{
5964
return CreateLogBackend("cerr",

ydb/public/lib/ydb_cli/commands/topic_operations_scenario.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class TTopicOperationsScenario {
4545
TString GetReadOnlyTableName() const;
4646
TString GetWriteOnlyTableName() const;
4747

48+
ui32 GetTopicMaxPartitionCount() const;
49+
4850
TDuration TotalSec;
4951
TDuration WindowSec;
5052
TDuration WarmupSec;
@@ -54,7 +56,7 @@ class TTopicOperationsScenario {
5456
TString TopicName;
5557
ui32 TopicPartitionCount = 1;
5658
bool TopicAutoscaling = false;
57-
ui32 TopicMaxPartitionCount = 100;
59+
ui32 TopicMaxPartitionCount = 1024;
5860
ui32 StabilizationWindowSeconds = 15;
5961
ui32 UpUtilizationPercent = 90;
6062
ui32 DownUtilizationPercent = 30;

ydb/public/lib/ydb_cli/commands/topic_workload/topic_workload_init.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using namespace NYdb::NConsoleClient;
1010

1111
int TCommandWorkloadTopicInit::TScenario::DoRun(const TConfig& config)
1212
{
13-
CreateTopic(config.Database, TopicName, TopicPartitionCount, ConsumerCount, TopicAutoscaling, TopicMaxPartitionCount, StabilizationWindowSeconds, UpUtilizationPercent, DownUtilizationPercent);
13+
CreateTopic(config.Database, TopicName, TopicPartitionCount, ConsumerCount, TopicAutoscaling, GetTopicMaxPartitionCount(), StabilizationWindowSeconds, UpUtilizationPercent, DownUtilizationPercent);
1414

1515
return EXIT_SUCCESS;
1616
}
@@ -45,8 +45,10 @@ void TCommandWorkloadTopicInit::Config(TConfig& config)
4545
.DefaultValue(false)
4646
.StoreTrue(&Scenario.TopicAutoscaling);
4747
config.Opts->AddLongOption('m', "auto-partitioning-max-partitions-count", "Max number of partitions in the topic.")
48+
.DefaultValue(1024)
4849
.StoreResult(&Scenario.TopicMaxPartitionCount);
4950
config.Opts->AddLongOption("auto-partitioning-stabilization-window-seconds", "Duration in seconds of high or low load before automatically scale the number of partitions")
51+
.DefaultValue(15)
5052
.Optional()
5153
.StoreResult(&Scenario.StabilizationWindowSeconds);
5254
config.Opts->AddLongOption("auto-partitioning-up-utilization-percent", "The load percentage at which the number of partitions will increase")

0 commit comments

Comments
 (0)