You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2023/01/11 15:19:02 UTC

[GitHub] [incubator-seatunnel] EricJoy2048 commented on a diff in pull request #3913: [Feature][Zeta] Zeta support print metrics information

EricJoy2048 commented on code in PR #3913:
URL: https://github.com/apache/incubator-seatunnel/pull/3913#discussion_r1067116619


##########
seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ClientExecuteCommand.java:
##########
@@ -89,9 +101,19 @@ public void execute() throws CommandExecuteException {
                     engineClient.createExecutionContext(configFile.toString(), jobConfig);
 
                 ClientJobProxy clientJobProxy = jobExecutionEnv.execute();
-                clientJobProxy.waitForJobComplete();
+                // get job id
                 long jobId = clientJobProxy.getJobId();
-                System.out.println(engineClient.getJobMetrics(jobId));
+                JobMetricsRunner jobMetricsRunner = new JobMetricsRunner(engineClient, jobId);
+                executorService = Executors.newSingleThreadScheduledExecutor();
+                executorService.scheduleAtFixedRate(jobMetricsRunner, 0,
+                        seaTunnelConfig.getEngineConfig().getPrintJobMetricsInfoInterval(), TimeUnit.SECONDS);
+                // get job start time
+                startTime = LocalDateTime.now();

Review Comment:
   Move `startTime = LocalDateTime.now();` before `ClientJobProxy clientJobProxy = jobExecutionEnv.execute();` ?



-- 
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: commits-unsubscribe@seatunnel.apache.org

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