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


##########
be/src/io/cache/block_file_cache_profile.cpp:
##########
@@ -21,56 +21,44 @@
 #include <memory>
 #include <string>
 
-namespace doris::io {
+#include "util/doris_metrics.h"
 
-DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_total, 
MetricUnit::OPERATIONS);
-DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_cache, 
MetricUnit::OPERATIONS);
-DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_remote, 
MetricUnit::OPERATIONS);
+namespace doris::io {
 
-std::shared_ptr<AtomicStatistics> FileCacheProfile::report(int64_t table_id) {
+std::shared_ptr<AtomicStatistics> FileCacheProfile::report() {
     std::shared_ptr<AtomicStatistics> stats = 
std::make_shared<AtomicStatistics>();
     std::lock_guard lock(_mtx);
-    auto& table_stats = _profile[table_id];
-    stats->num_io_bytes_read_from_cache += 
table_stats->num_io_bytes_read_from_cache;
-    stats->num_io_bytes_read_from_remote += 
table_stats->num_io_bytes_read_from_remote;
+    stats->num_io_bytes_read_from_cache += 
_profile->num_io_bytes_read_from_cache;
+    stats->num_io_bytes_read_from_remote += 
_profile->num_io_bytes_read_from_remote;
     return stats;
 }
 
-void FileCacheProfile::update(int64_t table_id, FileCacheStatistics* stats) {
-    std::shared_ptr<AtomicStatistics> count;
-    std::shared_ptr<FileCacheMetric> table_metric;
+void FileCacheProfile::update(FileCacheStatistics* stats) {

Review Comment:
   warning: method 'update' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/io/cache/block_file_cache_profile.h:66:
   ```diff
   -     void update(FileCacheStatistics* stats);
   +     static void update(FileCacheStatistics* stats);
   ```
   



##########
be/src/http/action/clear_file_cache_action.cpp:
##########
@@ -20,6 +20,7 @@
 #include <fmt/core.h>

Review Comment:
   warning: 'fmt/core.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <fmt/core.h>
            ^
   ```
   



##########
be/src/io/cache/block_file_cache_profile.cpp:
##########
@@ -21,56 +21,44 @@
 #include <memory>
 #include <string>
 
-namespace doris::io {
+#include "util/doris_metrics.h"
 
-DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_total, 
MetricUnit::OPERATIONS);
-DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_cache, 
MetricUnit::OPERATIONS);
-DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_remote, 
MetricUnit::OPERATIONS);
+namespace doris::io {
 
-std::shared_ptr<AtomicStatistics> FileCacheProfile::report(int64_t table_id) {
+std::shared_ptr<AtomicStatistics> FileCacheProfile::report() {

Review Comment:
   warning: method 'report' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/io/cache/block_file_cache_profile.h:72:
   ```diff
   -     std::shared_ptr<AtomicStatistics> report();
   +     static std::shared_ptr<AtomicStatistics> report();
   ```
   



-- 
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]

Reply via email to