[
https://issues.apache.org/jira/browse/GOBBLIN-2104?focusedWorklogId=926577&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-926577
]
ASF GitHub Bot logged work on GOBBLIN-2104:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Jul/24 21:40
Start Date: 18/Jul/24 21:40
Worklog Time Spent: 10m
Work Description: arjun4084346 commented on code in PR #3983:
URL: https://github.com/apache/gobblin/pull/3983#discussion_r1683538487
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/task/DagProcessingEngineMetrics.java:
##########
@@ -0,0 +1,177 @@
+/*
+ * 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.task;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
+import java.util.concurrent.ConcurrentMap;
+import javax.inject.Inject;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.gobblin.configuration.State;
+import org.apache.gobblin.instrumented.Instrumented;
+import org.apache.gobblin.metrics.ContextAwareMeter;
+import org.apache.gobblin.metrics.GobblinMetrics;
+import org.apache.gobblin.metrics.MetricContext;
+import org.apache.gobblin.metrics.MetricTagNames;
+import org.apache.gobblin.metrics.Tag;
+import org.apache.gobblin.service.modules.orchestration.DagActionStore;
+import org.apache.gobblin.metrics.ServiceMetricNames;
+
+/**
+ * Used to track all metrics relating to processing dagActions when
DagProcessingEngine is enabled. The metrics can be
+ * used to trace the number of dagActions (which can be further broken down by
type) at various points of the system,
+ * starting from addition to the DagActionStore to observation in the
DagActionChangeMonitor through the
+ * DagProcessingEngine pipeline (DagManagement -> DagTaskStreamImpl ->
MySqlMultiActiveLeaseArbiter -> DagProc).
+ */
+@Slf4j
+public class DagProcessingEngineMetrics {
+ MetricContext metricContext;
+ // Declare map of dagActionType to a ContextAwareMeter for each metric
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsStoredMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsObservedMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsLeasesObtainedMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsNoLongerLeasingMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsLeaseReminderScheduledMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsReminderProcessedMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsExceededMaxRetryMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsInitializeFailedMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsInitializeSucceededMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsActFailedMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsActSucceededMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsConcludeFailedMeterByDagActionType = new ConcurrentHashMap();
+ private ConcurrentMap<String, ContextAwareMeter>
dagActionsConcludeSucceededMeterByDagActionType = new ConcurrentHashMap();
Review Comment:
why should these not be of type `ConcurrentMap<DagActionStore.DagActionType,
ContextAwareMeter>` ?
that will avoid unnecessary calls to `.toStrings()` later
Issue Time Tracking
-------------------
Worklog Id: (was: 926577)
Time Spent: 2h 50m (was: 2h 40m)
> Initialize DagProcessingEngine Metrics
> --------------------------------------
>
> Key: GOBBLIN-2104
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2104
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-service
> Reporter: Urmi Mustafi
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)