github-actions[bot] commented on code in PR #24502:
URL: https://github.com/apache/doris/pull/24502#discussion_r1335065933


##########
be/src/util/debug_points.h:
##########
@@ -0,0 +1,67 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <atomic>
+#include <functional>
+#include <map>
+#include <memory>
+#include <string>
+
+#include "common/compiler_util.h"
+#include "common/config.h"
+
+#define DBUG_EXECUTE_IF(debug_point, code)                     \
+    if (UNLIKELY(config::enable_debug_points)) {               \
+        if (DebugPoints::instance()->is_enable(debug_point)) { \
+            code                                               \
+        }                                                      \
+    }
+
+namespace doris {
+
+struct DebugPoint {
+    std::atomic<int64_t> execute_num {0};
+    int64_t execute_limit = -1;
+    int64_t expire_ms = -1;
+};
+
+class DebugPoints {
+public:
+    bool is_enable(const std::string& name);
+    void add(const std::string& name, int64_t execute_limit, int64_t 
timeout_second);
+    void remove(const std::string& name);
+    void clear();
+
+    static DebugPoints* instance();
+
+private:
+    DebugPoints();
+
+    using DebugPointMap = std::map<std::string, std::shared_ptr<DebugPoint>>;
+
+    // handler(new_debug_points)
+    void update(std::function<void(DebugPointMap&)>&& handler);
+
+private:

Review Comment:
   warning: redundant access specifier has the same accessibility as the 
previous access specifier [readability-redundant-access-specifiers]
   
   ```suggestion
   
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/util/debug_points.h:52:** previously declared here
   ```cpp
   private:
   ^
   ```
   
   </details>
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to