w41ter commented on code in PR #60520:
URL: https://github.com/apache/doris/pull/60520#discussion_r2767387669


##########
cloud/src/recycler/recycler_operation_log.cpp:
##########
@@ -672,6 +684,53 @@ int InstanceRecycler::recycle_operation_logs() {
     size_t recycled_operation_log_data_size = 0;
 
     DORIS_CLOUD_DEFER {
+        metrics_context.finish_report();
+
+        if (stats_enabled) {
+            g_bvar_recycler_oplog_last_round_total_num.put({instance_id_},
+                                                           
oplog_stats.total_num.load());
+            g_bvar_recycler_oplog_last_round_not_recycled_num.put(
+                    {instance_id_}, oplog_stats.not_recycled_num.load());
+            if (oplog_stats.failed_num.load() > 0) {
+                g_bvar_recycler_oplog_recycle_failed_num.put({instance_id_},
+                                                             
oplog_stats.failed_num.load());

Review Comment:
   Just a thought: should we use `add` rather than `put` here?



##########
cloud/src/recycler/recycler_operation_log.cpp:
##########
@@ -672,6 +684,53 @@ int InstanceRecycler::recycle_operation_logs() {
     size_t recycled_operation_log_data_size = 0;
 
     DORIS_CLOUD_DEFER {
+        metrics_context.finish_report();
+
+        if (stats_enabled) {
+            g_bvar_recycler_oplog_last_round_total_num.put({instance_id_},
+                                                           
oplog_stats.total_num.load());
+            g_bvar_recycler_oplog_last_round_not_recycled_num.put(
+                    {instance_id_}, oplog_stats.not_recycled_num.load());
+            if (oplog_stats.failed_num.load() > 0) {
+                g_bvar_recycler_oplog_recycle_failed_num.put({instance_id_},
+                                                             
oplog_stats.failed_num.load());
+            }
+            // Per-type last round counts (mBvarStatus, overwritten each round)
+            g_bvar_recycler_oplog_last_round_recycled_commit_partition_num.put(
+                    {instance_id_}, 
oplog_stats.recycled_commit_partition.load());
+            g_bvar_recycler_oplog_last_round_recycled_drop_partition_num.put(
+                    {instance_id_}, 
oplog_stats.recycled_drop_partition.load());
+            g_bvar_recycler_oplog_last_round_recycled_commit_index_num.put(
+                    {instance_id_}, oplog_stats.recycled_commit_index.load());
+            g_bvar_recycler_oplog_last_round_recycled_drop_index_num.put(
+                    {instance_id_}, oplog_stats.recycled_drop_index.load());
+            g_bvar_recycler_oplog_last_round_recycled_update_tablet_num.put(
+                    {instance_id_}, oplog_stats.recycled_update_tablet.load());
+            g_bvar_recycler_oplog_last_round_recycled_compaction_num.put(
+                    {instance_id_}, oplog_stats.recycled_compaction.load());
+            g_bvar_recycler_oplog_last_round_recycled_schema_change_num.put(
+                    {instance_id_}, oplog_stats.recycled_schema_change.load());
+            g_bvar_recycler_oplog_last_round_recycled_commit_txn_num.put(
+                    {instance_id_}, oplog_stats.recycled_commit_txn.load());
+            // Per-type cumulative counts (mBvarIntAdder, accumulated across 
rounds)
+            g_bvar_recycler_oplog_recycled_commit_partition_num.put(
+                    {instance_id_}, 
oplog_stats.recycled_commit_partition.load());
+            g_bvar_recycler_oplog_recycled_drop_partition_num.put(
+                    {instance_id_}, 
oplog_stats.recycled_drop_partition.load());
+            g_bvar_recycler_oplog_recycled_commit_index_num.put(
+                    {instance_id_}, oplog_stats.recycled_commit_index.load());
+            g_bvar_recycler_oplog_recycled_drop_index_num.put(
+                    {instance_id_}, oplog_stats.recycled_drop_index.load());
+            g_bvar_recycler_oplog_recycled_update_tablet_num.put(
+                    {instance_id_}, oplog_stats.recycled_update_tablet.load());
+            g_bvar_recycler_oplog_recycled_compaction_num.put(
+                    {instance_id_}, oplog_stats.recycled_compaction.load());
+            g_bvar_recycler_oplog_recycled_schema_change_num.put(
+                    {instance_id_}, oplog_stats.recycled_schema_change.load());
+            g_bvar_recycler_oplog_recycled_commit_txn_num.put(
+                    {instance_id_}, oplog_stats.recycled_commit_txn.load());

Review Comment:
   `put` vs `add`



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