arjun4084346 commented on code in PR #3532:
URL: https://github.com/apache/gobblin/pull/3532#discussion_r936001512


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagerMetrics.java:
##########
@@ -0,0 +1,253 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.service.modules.orchestration;
+
+import com.codahale.metrics.MetricRegistry;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.Maps;
+import com.typesafe.config.Config;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.metrics.ContextAwareCounter;
+import org.apache.gobblin.metrics.ContextAwareGauge;
+import org.apache.gobblin.metrics.ContextAwareMeter;
+import org.apache.gobblin.metrics.MetricContext;
+import org.apache.gobblin.metrics.RootMetricContext;
+import org.apache.gobblin.metrics.ServiceMetricNames;
+import org.apache.gobblin.metrics.metric.filter.MetricNameRegexFilter;
+import org.apache.gobblin.service.FlowId;
+import org.apache.gobblin.service.RequesterService;
+import org.apache.gobblin.service.ServiceRequester;
+import org.apache.gobblin.service.modules.flowgraph.Dag;
+import org.apache.gobblin.service.modules.spec.JobExecutionPlan;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+@Slf4j
+public class DagManagerMetrics {
+  private static final Map<String, DagManager.FlowState> flowGauges = 
Maps.newConcurrentMap();
+  // Meters representing the total number of flows in a given state
+  private ContextAwareMeter allSuccessfulMeter;
+  private ContextAwareMeter allFailedMeter;
+  private ContextAwareMeter allRunningMeter;
+  private ContextAwareMeter allSlaExceededMeter;
+  private ContextAwareMeter allStartSlaExceededMeter;
+  // Meters representing the flows in a given state per flowgroup
+  private final Map<String, ContextAwareMeter> groupSuccessfulMeters = 
Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> groupFailureMeters = 
Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> groupStartSlaExceededMeters = 
Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> groupSlaExceededMeters = 
Maps.newConcurrentMap();
+
+  // Meters representing the jobs in a given state per executor
+  // These metrics need to be invoked differently to account for automated 
retries and multihop scenarios.
+  private final Map<String, ContextAwareMeter> executorSuccessMeters = 
Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> executorFailureMeters = 
Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> executorStartSlaExceededMeters 
= Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> executorSlaExceededMeters = 
Maps.newConcurrentMap();
+  private final Map<String, ContextAwareMeter> executorJobSentMeters = 
Maps.newConcurrentMap();
+  private boolean instrumentationEnabled;
+  MetricContext metricContext;
+
+  public DagManagerMetrics(MetricContext metricContext, boolean 
instrumentationEnabled) {

Review Comment:
   should we just have metricContext in this signature?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to