stats: remove deprecated -statshostname argument

This commit is contained in:
Kittywhiskers Van Gogh 2024-09-12 07:28:56 +00:00
parent a5a478fff3
commit 8a7a96c51f
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
2 changed files with 1 additions and 11 deletions

View File

@ -758,7 +758,6 @@ void SetupServerArgs(ArgsManager& argsman)
argsman.AddArg("-statsbatchsize=<bytes>", strprintf("Specify the size of each batch of stats messages (default: %d)", DEFAULT_STATSD_BATCH_SIZE), ArgsManager::ALLOW_ANY, OptionsCategory::STATSD);
argsman.AddArg("-statsduration=<ms>", strprintf("Specify the number of milliseconds between stats messages (default: %d)", DEFAULT_STATSD_DURATION), ArgsManager::ALLOW_ANY, OptionsCategory::STATSD);
argsman.AddArg("-statshost=<ip>", strprintf("Specify statsd host (default: %s)", DEFAULT_STATSD_HOST), ArgsManager::ALLOW_ANY, OptionsCategory::STATSD);
hidden_args.emplace_back("-statshostname");
argsman.AddArg("-statsport=<port>", strprintf("Specify statsd port (default: %u)", DEFAULT_STATSD_PORT), ArgsManager::ALLOW_ANY, OptionsCategory::STATSD);
argsman.AddArg("-statsperiod=<seconds>", strprintf("Specify the number of seconds between periodic measurements (default: %d)", DEFAULT_STATSD_PERIOD), ArgsManager::ALLOW_ANY, OptionsCategory::STATSD);
argsman.AddArg("-statsprefix=<string>", strprintf("Specify an optional string prepended to every stats key (default: %s)", DEFAULT_STATSD_PREFIX), ArgsManager::ALLOW_ANY, OptionsCategory::STATSD);

View File

@ -43,22 +43,13 @@ std::unique_ptr<StatsdClient> InitStatsClient(const ArgsManager& args)
return string;
};
auto suffix = args.GetArg("-statssuffix", DEFAULT_STATSD_SUFFIX);
if (suffix.empty()) {
suffix = args.GetArg("-statshostname", DEFAULT_STATSD_SUFFIX);
} else {
// We restrict sanitization logic to our newly added arguments to
// prevent breaking changes.
sanitize_string(suffix);
}
return std::make_unique<StatsdClient>(
args.GetArg("-statshost", DEFAULT_STATSD_HOST),
args.GetArg("-statsport", DEFAULT_STATSD_PORT),
args.GetArg("-statsbatchsize", DEFAULT_STATSD_BATCH_SIZE),
args.GetArg("-statsduration", DEFAULT_STATSD_DURATION),
sanitize_string(args.GetArg("-statsprefix", DEFAULT_STATSD_PREFIX)),
suffix
sanitize_string(args.GetArg("-statssuffix", DEFAULT_STATSD_SUFFIX))
);
}