You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/31 12:56:50 UTC

[GitHub] [incubator-doris] carlvinhust2012 commented on a diff in pull request #9887: [Enhancement] add some metrics for cpu and memory

carlvinhust2012 commented on code in PR #9887:
URL: https://github.com/apache/incubator-doris/pull/9887#discussion_r885603919


##########
be/src/util/system_metrics.cpp:
##########
@@ -718,4 +788,174 @@ void SystemMetrics::get_max_net_traffic(const std::map<std::string, int64_t>& ls
     *send_rate = max_send / interval_sec;
     *rcv_rate = max_rcv / interval_sec;
 }
+
+void SystemMetrics::_install_proc_metrics(MetricEntity* entity) {
+    _proc_metrics.reset(new ProcMetrics(entity));
+}
+
+void SystemMetrics::_update_proc_metrics() {
+#ifdef BE_TEST
+    FILE* fp = fopen(k_ut_stat_path, "r");
+#else
+    FILE* fp = fopen("/proc/stat", "r");

Review Comment:
   because I want to keep the style with the old code.



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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