You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/04/30 02:05:33 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #1079: Add some pre-calculated metrics

imay commented on a change in pull request #1079: Add some pre-calculated metrics
URL: https://github.com/apache/incubator-doris/pull/1079#discussion_r279596759
 
 

 ##########
 File path: be/src/util/system_metrics.cpp
 ##########
 @@ -435,4 +435,65 @@ void SystemMetrics::_update_fd_metrics() {
     fclose(fp);
 }
 
+int64_t SystemMetrics::get_max_io_util(
+        const std::map<std::string, int64_t>& lst_value, int64_t interval_sec) {
+    int64_t max = 0;
+    for (auto& it : _disk_metrics) {
+        int64_t cur = it.second->io_time_ms.value();
+        const auto& find = lst_value.find(it.first);
+        if (find == lst_value.end()) {
+            continue;
+        }
+        int64_t incr = cur - find->second;
+        if (incr > max) max = incr;
+    }
+    return max / interval_sec / 10;
+}
+
+void SystemMetrics::get_disks_io_time(std::map<std::string, int64_t>& map) {
+    map.clear();
 
 Review comment:
   I think that caller clear is better 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org