github-actions[bot] commented on code in PR #35527:
URL: https://github.com/apache/doris/pull/35527#discussion_r1616857370
##########
be/src/http/action/show_hotspot_action.cpp:
##########
@@ -0,0 +1,149 @@
+#include "show_hotspot_action.h"
+
+#include <queue>
+#include <string>
+
+#include "cloud/cloud_tablet_mgr.h"
+#include "http/http_channel.h"
+#include "http/http_request.h"
+
+namespace doris {
+namespace {
+
+enum class Metrics {
+ READ_BLOCK = 0,
+ WRITE = 1,
+ COMPACTION = 2,
+ NUM_ROWSETS = 3,
+ NUM_BASE_ROWSETS = 4,
+ NUM_CUMU_ROWSETS = 5,
+};
+
+Status check_param(HttpRequest* req, int& top_n, Metrics& metrics) {
+ const std::string TOPN_PARAM = "topn";
+
+ auto& topn_str = req->param(TOPN_PARAM);
+ if (!topn_str.empty()) {
+ try {
+ top_n = std::stoi(topn_str);
+ } catch (const std::exception& e) {
+ return Status::InternalError("convert topn failed, {}", e.what());
+ }
+ }
+
+ const std::string METRICS_PARAM = "metrics";
+ auto& metrics_str = req->param(METRICS_PARAM);
Review Comment:
warning: 'auto &metrics_str' can be declared as 'const auto &metrics_str'
[readability-qualified-auto]
```suggestion
const auto& metrics_str = req->param(METRICS_PARAM);
```
##########
be/src/http/action/show_hotspot_action.cpp:
##########
@@ -0,0 +1,149 @@
+#include "show_hotspot_action.h"
+
+#include <queue>
+#include <string>
+
+#include "cloud/cloud_tablet_mgr.h"
+#include "http/http_channel.h"
+#include "http/http_request.h"
+
+namespace doris {
+namespace {
+
+enum class Metrics {
+ READ_BLOCK = 0,
+ WRITE = 1,
+ COMPACTION = 2,
+ NUM_ROWSETS = 3,
+ NUM_BASE_ROWSETS = 4,
+ NUM_CUMU_ROWSETS = 5,
+};
+
+Status check_param(HttpRequest* req, int& top_n, Metrics& metrics) {
+ const std::string TOPN_PARAM = "topn";
+
+ auto& topn_str = req->param(TOPN_PARAM);
Review Comment:
warning: 'auto &topn_str' can be declared as 'const auto &topn_str'
[readability-qualified-auto]
```suggestion
const auto& topn_str = req->param(TOPN_PARAM);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]