Skip to content

Commit

Permalink
config: New configuration values for usage
Browse files Browse the repository at this point in the history
- These two configuration properties control the bucketing interval and
length of history that will be kept for the new usage tracking mechanism.
  • Loading branch information
graphcareful committed Mar 13, 2023
1 parent 6917e90 commit 5379729
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/v/config/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,41 @@ configuration::configuration()
{.needs_restart = needs_restart::no, .visibility = visibility::tunable},
512_KiB,
{.min = 128, .max = 5_MiB})
, enable_usage(
*this,
"enable_usage",
"Enables the usage tracking mechanism, storing windowed history of "
"kafka/cloud_storage metrics over time",
{.needs_restart = needs_restart::no, .visibility = visibility::user},
false)
, usage_num_windows(
*this,
"usage_num_windows",
"The number of windows to persist in memory and disk",
{.needs_restart = needs_restart::no,
.example = "24",
.visibility = visibility::tunable},
24,
{.min = 2, .max = 86400})
, usage_window_width_interval_sec(
*this,
"usage_window_width_interval_sec",
"The width of a usage window, tracking cloud and kafka ingress/egress "
"traffic each interval",
{.needs_restart = needs_restart::no,
.example = "3600",
.visibility = visibility::tunable},
std::chrono::seconds(3600),
{.min = std::chrono::seconds(1)})
, usage_disk_persistance_interval_sec(
*this,
"usage_disk_persistance_interval_sec",
"The interval in which all usage stats are written to disk",
{.needs_restart = needs_restart::no,
.example = "300",
.visibility = visibility::tunable},
std::chrono::seconds(60 * 5),
{.min = std::chrono::seconds(1)})
, use_scheduling_groups(*this, "use_scheduling_groups")
, enable_admin_api(*this, "enable_admin_api")
, default_num_windows(
Expand Down
4 changes: 4 additions & 0 deletions src/v/config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ struct configuration final : public config_store {
bounded_property<std::optional<size_t>> raft_max_recovery_memory;
bounded_property<size_t> raft_recovery_default_read_size;
// Kafka
property<bool> enable_usage;
bounded_property<size_t> usage_num_windows;
bounded_property<std::chrono::seconds> usage_window_width_interval_sec;
bounded_property<std::chrono::seconds> usage_disk_persistance_interval_sec;
deprecated_property use_scheduling_groups;
deprecated_property enable_admin_api;
bounded_property<int16_t> default_num_windows;
Expand Down

0 comments on commit 5379729

Please sign in to comment.