EricGao888 commented on code in PR #13640:
URL: 
https://github.com/apache/dolphinscheduler/pull/13640#discussion_r1127626730


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/metrics/ProcessInstanceMetrics.java:
##########
@@ -82,8 +78,26 @@ public synchronized void 
registerProcessInstanceResubmitGauge(Supplier<Number> f
                 .register(Metrics.globalRegistry);
     }
 
-    public void incProcessInstanceByState(final String state) {
-        processInstanceCounters.get(state).increment();
+    public void incProcessInstanceByStateAndProcessDefinitionCode(final String 
state,
+                                                                  final String 
processDefinitionCode) {

Review Comment:
   ```sql
   DROP TABLE IF EXISTS `t_ds_process_definition`;
   CREATE TABLE `t_ds_process_definition` (
     `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
     `code` bigint(20) NOT NULL COMMENT 'encoding',
     `name` varchar(255) DEFAULT NULL COMMENT 'process definition name',
     `version` int(11) DEFAULT '0' COMMENT 'process definition version',
     `description` text COMMENT 'description',
     `project_code` bigint(20) NOT NULL COMMENT 'project code',
     `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition 
release state:0:offline,1:online',
     `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
     `global_params` text COMMENT 'global parameters',
     `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
     `locations` text COMMENT 'Node location information',
     `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
     `timeout` int(11) DEFAULT '0' COMMENT 'time out, unit: minute',
     `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
     `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 
0:parallel,1:serial wait,2:serial discard,3:serial priority',
     `create_time` datetime NOT NULL COMMENT 'create time',
     `update_time` datetime NOT NULL COMMENT 'update time',
     PRIMARY KEY (`id`,`code`),
     UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE
   ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;
   ```
   
   Looks like there could be duplicate workflow definition names in two 
different projects. Changing tag to it might lead to miscounting.



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