Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make bvar_max_dump_multi_dimension_metric_number modifiable #2322

Merged
merged 2 commits into from
Jul 26, 2023
Merged
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
14 changes: 13 additions & 1 deletion src/bvar/mvariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DECLARE_bool(bvar_abort_on_same_name);
extern bool s_bvar_may_abort;

DEFINE_int32(bvar_max_multi_dimension_metric_number, 1024, "Max number of multi dimension");
DEFINE_int32(bvar_max_dump_multi_dimension_metric_number, 0,
DEFINE_int32(bvar_max_dump_multi_dimension_metric_number, 1024,
serverglen marked this conversation as resolved.
Show resolved Hide resolved
"Max number of multi dimension metric number to dump by prometheus rpc service");

static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_t v) {
Expand All @@ -47,9 +47,21 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
return true;
}

static bool validator_bvar_max_dump_multi_dimension_metric_number(const char*, int32_t v) {
if (v < 0) {
LOG(ERROR) << "Invalid bvar_max_dump_multi_dimension_metric_number=" << v;
return false;
}
return true;
}


const bool ALLOW_UNUSED dummp_bvar_max_multi_dimension_metric_number = ::GFLAGS_NS::RegisterFlagValidator(
&FLAGS_bvar_max_multi_dimension_metric_number, validator_bvar_max_multi_dimension_metric_number);

const bool ALLOW_UNUSED dummp_bvar_max_dump_multi_dimension_metric_number = ::GFLAGS_NS::RegisterFlagValidator(
&FLAGS_bvar_max_dump_multi_dimension_metric_number, validator_bvar_max_dump_multi_dimension_metric_number);

class MVarEntry {
public:
MVarEntry() : var(NULL) {}
Expand Down
Loading