You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/09/22 08:03:43 UTC

[GitHub] [ozone] xichen01 opened a new pull request, #3772: HDDS-7250. Add HttpServer metrics

xichen01 opened a new pull request, #3772:
URL: https://github.com/apache/ozone/pull/3772

   ## What changes were proposed in this pull request?
   Add some metrics to monitor `HttpServer` threadpool.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7250
   
   Please replace this section with the link to the Apache JIRA)
   
   ## How was this patch tested?
   for `SCM`
   ```bash
   [root@Linux /root/ozone]% curl -s http://0.0.0.0:9876/prom | grep -i http
   # TYPE http_server2_metrics_http_server_idle_thread_count gauge
   http_server2_metrics_http_server_idle_thread_count{context="HttpServer2",server_name="scm",hostname="C02GKEF9MD6M"} 0
   # TYPE http_server2_metrics_http_server_max_thread_count gauge
   http_server2_metrics_http_server_max_thread_count{context="HttpServer2",server_name="scm",hostname="C02GKEF9MD6M"} 200
   # TYPE http_server2_metrics_http_server_thread_count gauge
   http_server2_metrics_http_server_thread_count{context="HttpServer2",server_name="scm",hostname="C02GKEF9MD6M"} 9
   # TYPE http_server2_metrics_http_server_thread_queue_waiting_task_count gauge
   http_server2_metrics_http_server_thread_queue_waiting_task_count{context="HttpServer2",server_name="scm",hostname="C02GKEF9MD6M"} 0
   ```
   for `OM`
   ```bash
   [root@Linux /root/ozone]% curl -s http://0.0.0.0:9874/prom | grep -i http
   # TYPE http_server2_metrics_http_server_idle_thread_count gauge
   http_server2_metrics_http_server_idle_thread_count{context="HttpServer2",server_name="ozoneManager",hostname="C02GKEF9MD6M"} 0
   # TYPE http_server2_metrics_http_server_max_thread_count gauge
   http_server2_metrics_http_server_max_thread_count{context="HttpServer2",server_name="ozoneManager",hostname="C02GKEF9MD6M"} 200
   # TYPE http_server2_metrics_http_server_thread_count gauge
   http_server2_metrics_http_server_thread_count{context="HttpServer2",server_name="ozoneManager",hostname="C02GKEF9MD6M"} 9
   # TYPE http_server2_metrics_http_server_thread_queue_waiting_task_count gauge
   http_server2_metrics_http_server_thread_queue_waiting_task_count{context="HttpServer2",server_name="ozoneManager",hostname="C02GKEF9MD6M"} 0
   ```
   Similarly, other components can also get similar metrics
   


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a diff in pull request #3772: HDDS-7250. Add HttpServer metrics

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on code in PR #3772:
URL: https://github.com/apache/ozone/pull/3772#discussion_r984401332


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2Metrics.java:
##########
@@ -91,4 +90,10 @@ public void getMetrics(MetricsCollector collector, boolean all) {
         .addGauge(HttpServer2MetricsInfo.HttpServerThreadQueueWaitingTaskCount,
             threadPool.getQueueSize());
   }
+
+  public void unRegister() {
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    ms.unregisterSource(NAME);

Review Comment:
   If we want to allow multiple `HttpServer2` objects to share the same `HttpServer2Metrics` instance, then it should be reference-counted, and unregistration should happen only when the last reference is removed.



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2Metrics.java:
##########
@@ -91,4 +90,10 @@ public void getMetrics(MetricsCollector collector, boolean all) {
         .addGauge(HttpServer2MetricsInfo.HttpServerThreadQueueWaitingTaskCount,
             threadPool.getQueueSize());
   }
+
+  public void unRegister() {

Review Comment:
   Should be `synchronized` to ensure consistent synchronization when accessing `instance`.  (I guess findbugs also complains about this.)



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a diff in pull request #3772: HDDS-7250. Add HttpServer metrics

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on code in PR #3772:
URL: https://github.com/apache/ozone/pull/3772#discussion_r984425225


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2Metrics.java:
##########
@@ -91,4 +90,10 @@ public void getMetrics(MetricsCollector collector, boolean all) {
         .addGauge(HttpServer2MetricsInfo.HttpServerThreadQueueWaitingTaskCount,
             threadPool.getQueueSize());
   }
+
+  public void unRegister() {
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    ms.unregisterSource(NAME);

Review Comment:
   I'm not aware of it.  But then why bother with making it a singleton?



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] xichen01 commented on a diff in pull request #3772: HDDS-7250. Add HttpServer metrics

Posted by GitBox <gi...@apache.org>.
xichen01 commented on code in PR #3772:
URL: https://github.com/apache/ozone/pull/3772#discussion_r984516703


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2Metrics.java:
##########
@@ -91,4 +90,10 @@ public void getMetrics(MetricsCollector collector, boolean all) {
         .addGauge(HttpServer2MetricsInfo.HttpServerThreadQueueWaitingTaskCount,
             threadPool.getQueueSize());
   }
+
+  public void unRegister() {
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    ms.unregisterSource(NAME);

Review Comment:
   Initially to fix the test, but , i think having `HttpServer2Metrics` `unRegister` when `HttpServer2` stops will fix the test, needn't make it a singleton



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] xichen01 closed pull request #3772: HDDS-7250. Add HttpServer metrics

Posted by GitBox <gi...@apache.org>.
xichen01 closed pull request #3772: HDDS-7250. Add HttpServer metrics
URL: https://github.com/apache/ozone/pull/3772


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] xichen01 commented on a diff in pull request #3772: HDDS-7250. Add HttpServer metrics

Posted by GitBox <gi...@apache.org>.
xichen01 commented on code in PR #3772:
URL: https://github.com/apache/ozone/pull/3772#discussion_r984421566


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2Metrics.java:
##########
@@ -91,4 +90,10 @@ public void getMetrics(MetricsCollector collector, boolean all) {
         .addGauge(HttpServer2MetricsInfo.HttpServerThreadQueueWaitingTaskCount,
             threadPool.getQueueSize());
   }
+
+  public void unRegister() {
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    ms.unregisterSource(NAME);

Review Comment:
   Is there a scenario where multiple `HttpServer2` are created in a process, except in testing, or may exist in the future?



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3772: HDDS-7250. Add HttpServer metrics

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #3772:
URL: https://github.com/apache/ozone/pull/3772#issuecomment-1257932652

   @duongkame please review


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org