Smityz commented on a change in pull request #592:
URL: https://github.com/apache/incubator-pegasus/pull/592#discussion_r486846003



##########
File path: src/server/hotspot_partition_calculator.h
##########
@@ -24,6 +24,9 @@
 namespace pegasus {
 namespace server {
 
+typedef std::list<std::vector<hotspot_partition_data>> statistical_histories;
+typedef std::vector<std::vector<std::unique_ptr<dsn::perf_counter_wrapper>>> 
hot_partition_counters;

Review comment:
       If do like that, I will write two duplicate codes to complete one 
function.
   I admit this is a complex structure, but I can do like this to avoid copying 
codes.
   ```c++
       for (int data_type = 0; data_type <= 1; data_type++) {
           // 0: READ_HOTSPOT_DATA; 1: WRITE_HOTSPOT_DATA
          ...
           for (const auto &one_partition_stat_histories : 
_partitions_stat_histories) {
               for (const auto &partition_stat : one_partition_stat_histories) {
                   if (partition_stat.total_qps[data_type] > 1.00) {
                       table_qps_sum += partition_stat.total_qps[data_type];
                       ...
                   }
               }
           }
   ```
   `statistical_histories` will be renamed into `partitions_stat_histories`, 
which stores the whole histories of all partitions in one table.




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

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