This is an automated email from the ASF dual-hosted git repository.

wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new dfd4f0d8f refactor: replace perf-counters with new metrics in some 
names and comments (#1925)
dfd4f0d8f is described below

commit dfd4f0d8fb5545e4c24b8e2d82f75779be52e4de
Author: Dan Wang <[email protected]>
AuthorDate: Fri Mar 1 11:07:18 2024 +0800

    refactor: replace perf-counters with new metrics in some names and comments 
(#1925)
---
 src/meta/meta_data.cpp                       | 2 +-
 src/replica/bulk_load/replica_bulk_loader.h  | 3 ++-
 src/replica/duplication/mutation_batch.cpp   | 2 +-
 src/replica/replica.h                        | 1 -
 src/replica/replica_context.h                | 2 +-
 src/replica/split/replica_split_manager.h    | 2 +-
 src/runtime/profiler.h                       | 4 ++--
 src/server/pegasus_write_service.h           | 2 +-
 src/server/test/pegasus_server_impl_test.cpp | 8 ++++----
 src/utils/api_utilities.h                    | 5 +----
 10 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/src/meta/meta_data.cpp b/src/meta/meta_data.cpp
index 46cd8ac5c..33af19262 100644
--- a/src/meta/meta_data.cpp
+++ b/src/meta/meta_data.cpp
@@ -235,7 +235,7 @@ void proposal_actions::track_current_learner(const 
dsn::rpc_address &node, const
                 current_learner.last_committed_decree > 
info.last_committed_decree ||
                 current_learner.last_prepared_decree > 
info.last_prepared_decree) {
 
-                // TODO: need to add a perf counter here
+                // TODO: need to add a metric here.
                 LOG_WARNING("{}: learner({})'s progress step back, please 
trace this carefully",
                             info.pid,
                             node);
diff --git a/src/replica/bulk_load/replica_bulk_loader.h 
b/src/replica/bulk_load/replica_bulk_loader.h
index 5559f6d4a..92f76810c 100644
--- a/src/replica/bulk_load/replica_bulk_loader.h
+++ b/src/replica/bulk_load/replica_bulk_loader.h
@@ -194,7 +194,8 @@ private:
     std::map<std::string, task_ptr> _download_files_task;
     // download metadata and create download file tasks
     task_ptr _download_task;
-    // Used for perf-counter
+
+    // Used for metrics.
     uint64_t _bulk_load_start_time_ms{0};
 
     METRIC_VAR_DECLARE_counter(bulk_load_downloading_count);
diff --git a/src/replica/duplication/mutation_batch.cpp 
b/src/replica/duplication/mutation_batch.cpp
index 8b7a815fc..e6d91d5f2 100644
--- a/src/replica/duplication/mutation_batch.cpp
+++ b/src/replica/duplication/mutation_batch.cpp
@@ -74,7 +74,7 @@ void mutation_buffer::commit(decree d, commit_type ct)
         //             n+m(m>1)            n+k(k>=m)
         //
         // just LOG_ERROR but not CHECK if mutation loss or other problem, 
it's different from
-        // base class implement. And from the error and perf-counter, we can 
choose restart
+        // base class implement. And based on the error and metric, we can 
choose to restart
         // duplication or ignore the loss.
         if (next_committed_mutation == nullptr || 
!next_committed_mutation->is_logged()) {
             LOG_ERROR_PREFIX("mutation[{}] is lost in prepare_list: "
diff --git a/src/replica/replica.h b/src/replica/replica.h
index 83e78105a..8ba5bde32 100644
--- a/src/replica/replica.h
+++ b/src/replica/replica.h
@@ -641,7 +641,6 @@ private:
 
     std::unique_ptr<replica_follower> _replica_follower;
 
-    // perf counters
     METRIC_VAR_DECLARE_gauge_int64(private_log_size_mb);
     METRIC_VAR_DECLARE_counter(throttling_delayed_write_requests);
     METRIC_VAR_DECLARE_counter(throttling_rejected_write_requests);
diff --git a/src/replica/replica_context.h b/src/replica/replica_context.h
index 32da41d38..3b6220fa2 100644
--- a/src/replica/replica_context.h
+++ b/src/replica/replica_context.h
@@ -285,7 +285,7 @@ public:
     // see more in function `child_check_split_context` and 
`parent_check_states`
     task_ptr check_state_task;
 
-    // Used for split related perf-counter
+    // Used for split-related metrics.
     uint64_t splitting_start_ts_ns{0};
     uint64_t splitting_start_async_learn_ts_ns{0};
     uint64_t splitting_copy_file_count{0};
diff --git a/src/replica/split/replica_split_manager.h 
b/src/replica/split/replica_split_manager.h
index 7435e1705..00c6f81ef 100644
--- a/src/replica/split/replica_split_manager.h
+++ b/src/replica/split/replica_split_manager.h
@@ -94,7 +94,7 @@ private:
                             uint64_t total_file_size,
                             decree last_committed_decree);
 
-    // TODO(heyuchen): total_file_size is used for split perf-counter in 
further pull request
+    // TODO(heyuchen): total_file_size is used for split-related  metrics in 
further pull request.
     // Applies mutation logs that were learned from the parent of this child.
     // This stage follows after that child applies the checkpoint of parent, 
and begins to apply the
     // mutations.
diff --git a/src/runtime/profiler.h b/src/runtime/profiler.h
index d283a5b4a..a4630d226 100644
--- a/src/runtime/profiler.h
+++ b/src/runtime/profiler.h
@@ -34,8 +34,8 @@
 
 Profiler toollet
 
-This toollet collects many performance counter values for the specified tasks,
-as configed below.
+This toollet collects many performance metrics for the specified tasks,
+as configured below.
 
 <PRE>
 
diff --git a/src/server/pegasus_write_service.h 
b/src/server/pegasus_write_service.h
index 18db63817..eed596e35 100644
--- a/src/server/pegasus_write_service.h
+++ b/src/server/pegasus_write_service.h
@@ -239,7 +239,7 @@ private:
     uint32_t _put_batch_size;
     uint32_t _remove_batch_size;
 
-    // TODO(wutao1): add perf counters for failed rpc.
+    // TODO(wutao1): add metrics for failed rpc.
 };
 
 } // namespace server
diff --git a/src/server/test/pegasus_server_impl_test.cpp 
b/src/server/test/pegasus_server_impl_test.cpp
index 0508e7ce5..a1cf77db4 100644
--- a/src/server/test/pegasus_server_impl_test.cpp
+++ b/src/server/test/pegasus_server_impl_test.cpp
@@ -53,13 +53,13 @@ public:
 
     void test_table_level_slow_query()
     {
-        // the on_get function will sleep 10ms for unit test,
-        // so when we set slow_query_threshold <= 10ms, the perf counter will 
be incr by 1
+        // The function `on_get` will sleep 10ms for the unit test. Thus when 
we set
+        // slow_query_threshold <= 10ms, the metric `abnormal_read_requests` 
will increment by 1.
         struct test_case
         {
             bool is_multi_get; // false-on_get, true-on_multi_get
             uint64_t slow_query_threshold_ms;
-            uint8_t expect_perf_counter_incr;
+            uint8_t expected_incr;
         } tests[] = {{false, 10, 1}, {false, 300, 0}, {true, 10, 1}, {true, 
300, 0}};
 
         // test key
@@ -93,7 +93,7 @@ public:
             }
             auto after_count = 
_server->METRIC_VAR_VALUE(abnormal_read_requests);
 
-            ASSERT_EQ(before_count + test.expect_perf_counter_incr, 
after_count);
+            ASSERT_EQ(before_count + test.expected_incr, after_count);
         }
     }
 
diff --git a/src/utils/api_utilities.h b/src/utils/api_utilities.h
index 537ceaaed..ec0733ae5 100644
--- a/src/utils/api_utilities.h
+++ b/src/utils/api_utilities.h
@@ -24,10 +24,7 @@
  * THE SOFTWARE.
  */
 
-// some useful utility functions provided by rDSN,
-// such as logging, performance counter, checksum,
-// command line interface registration and invocation,
-// etc.
+// Some useful utility functions for logging and mocking provided by rDSN.
 
 #pragma once
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to