You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2020/11/05 08:01:59 UTC

[GitHub] [zeppelin] Reamer commented on a change in pull request #3964: [ZEPPELIN-4977] Metrics and healthcheck

Reamer commented on a change in pull request #3964:
URL: https://github.com/apache/zeppelin/pull/3964#discussion_r517854469



##########
File path: zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
##########
@@ -321,6 +326,21 @@ public void saveToFile() throws IOException {
     configStorage.save(info);
   }
 
+  private void initMetrics() {
+    // This class should  be a singleton
+    // Tests create more instances
+    Metrics.getMetricRegistry().removeMatching(
+      MetricFilter.startsWith(MetricRegistry.name(METRICS_PREFIX_INTERPRETER)));
+    Metrics.getMetricRegistry().<Gauge<Integer>>register(MetricRegistry.name(METRICS_PREFIX_INTERPRETER, "amount"),
+      interpreterSettings::size);
+    Metrics.getMetricRegistry().<Gauge<Integer>>register(MetricRegistry.name(METRICS_PREFIX_INTERPRETER, "group", "size"),
+      () -> getAllInterpreterGroup().size());
+    for (Map.Entry<String, InterpreterSetting> interpreterSetting : interpreterSettings.entrySet()) {

Review comment:
       Not dynamic, we should register the metric when the interpreter is created and remove the registration when the interpreter is removed.




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