-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
trivial(stats): remove deprecated arguments -stats{enabled,hostname,ns}
#6505
Conversation
-stats{enabled,hostname,ns}
-stats{enabled,hostname,ns}
WalkthroughThis change removes several previously deprecated statistics-related command-line arguments and refines the configuration of statistics reporting. The release notes have been updated to document the removal of three command-line arguments that were deprecated in an earlier version. In the core setup, hidden statistics parameters are eliminated in favor of newly introduced arguments that provide explicit configuration for aspects such as batch size, duration, host, port, period, prefix, and suffix. Additionally, initialization logic within the statistics client has been simplified by removing conditional checks and a redundant 'enabled' flag. These modifications also affect public declarations, with updates to method and constructor signatures to reflect the streamlined parameter list. Overall, the changes focus on enhancing clarity and precision in configuring and initializing statistics functionality in the system. Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/stats/client.cpp (2)
36-44
: Consider improving lambda function signature.The lambda function takes the string parameter by value which is good for clarity, but consider using
std::string_view
for better performance since the function only reads the string.- auto sanitize_string = [](std::string string) { + auto sanitize_string = [](std::string_view string) { - if (!string.empty()) { - if (string.front() == STATSD_NS_DELIMITER) string.erase(string.begin()); - if (string.back() == STATSD_NS_DELIMITER) string.pop_back(); - } - return string; + if (string.empty()) return std::string{}; + size_t start = string.front() == STATSD_NS_DELIMITER ? 1 : 0; + size_t length = string.length() - start - (string.back() == STATSD_NS_DELIMITER ? 1 : 0); + return std::string{string.substr(start, length)};
54-57
: Consider simplifying lambda expressions.The lambda expressions for prefix and suffix could be simplified since they're only used once.
- m_prefix{[prefix]() { return !prefix.empty() ? prefix + STATSD_NS_DELIMITER : prefix; }()}, - m_suffix{[suffix]() { return !suffix.empty() ? STATSD_NS_DELIMITER + suffix : suffix; }()} + m_prefix{!prefix.empty() ? prefix + STATSD_NS_DELIMITER : prefix}, + m_suffix{!suffix.empty() ? STATSD_NS_DELIMITER + suffix : suffix}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
doc/release-notes-6505.md
(1 hunks)src/init.cpp
(0 hunks)src/stats/client.cpp
(1 hunks)src/stats/client.h
(1 hunks)
💤 Files with no reviewable changes (1)
- src/init.cpp
✅ Files skipped from review due to trivial changes (1)
- doc/release-notes-6505.md
🔇 Additional comments (3)
src/stats/client.h (1)
42-43
: LGTM! Constructor signature updated correctly.The removal of the
enabled
parameter from the constructor aligns with the PR objectives to remove deprecated stats arguments. The remaining parameters provide all necessary configuration options.src/stats/client.cpp (2)
46-51
: LGTM! Simplified initialization with clear argument mapping.The initialization is now more straightforward with direct mapping of command-line arguments to constructor parameters. The removal of conditional logic for
enabled
aligns with PR objectives.
59-62
: LGTM! Clear host validation logic.The empty host check provides a clear way to disable stats transmission, replacing the previous
enabled
flag functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK d673ede
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK d673ede
Breaking Changes
-statsenabled
,-statsns
,-statshostname
have been removed. They were previously deprecated in v22.0 and will no longer be recognized on runtime.Checklist