feat: 3.2.0

工作流Dashboard统计
This commit is contained in:
zhengweilin 2024-03-22 17:58:47 +08:00
parent 4bfbd0c76c
commit 700b0091dc
4 changed files with 35 additions and 7 deletions

View File

@ -27,5 +27,5 @@ public interface JobTaskBatchMapper extends BaseMapper<JobTaskBatch> {
List<JobBatchResponseDO> selectJobBatchListByIds(@Param("ids") List<Long> ids);
List<JobBatchSummaryResponseDO> summaryJobBatchList(@Param("from") LocalDateTime todayFrom, @Param("to") LocalDateTime to);
List<JobBatchSummaryResponseDO> summaryJobBatchList(@Param("type") Integer type, @Param("from") LocalDateTime todayFrom, @Param("to") LocalDateTime to);
}

View File

@ -55,7 +55,7 @@
SUM(CASE WHEN (task_batch_status = 5) THEN 1 ELSE 0 END) AS stopNum,
SUM(CASE WHEN (task_batch_status = 4) THEN 1 ELSE 0 END) AS failNum
FROM job_task_batch
WHERE create_dt BETWEEN #{from} AND #{to}
WHERE system_task_type = #{type} AND create_dt BETWEEN #{from} AND #{to}
GROUP BY namespace_id, group_name, job_id, task_batch_status, operation_reason
</select>

View File

@ -6,6 +6,7 @@ import com.aizuda.easy.retry.common.core.util.JsonUtil;
import com.aizuda.easy.retry.server.common.Lifecycle;
import com.aizuda.easy.retry.server.common.config.SystemProperties;
import com.aizuda.easy.retry.server.common.dto.JobTaskBatchReason;
import com.aizuda.easy.retry.server.common.enums.SyetemTaskTypeEnum;
import com.aizuda.easy.retry.server.common.schedule.AbstractSchedule;
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO;
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper;
@ -62,14 +63,14 @@ public class JobSummarySchedule extends AbstractSchedule implements Lifecycle {
// 定时按日实时查询统计数据00:00:00 - 23:59:59
LocalDateTime todayFrom = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-i);
LocalDateTime todayTo = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).plusDays(-i);
List<JobBatchSummaryResponseDO> summaryResponseDOList = jobTaskBatchMapper.summaryJobBatchList(todayFrom, todayTo);
List<JobBatchSummaryResponseDO> summaryResponseDOList = jobTaskBatchMapper.summaryJobBatchList(SyetemTaskTypeEnum.JOB.getType(), todayFrom, todayTo);
if (summaryResponseDOList == null || summaryResponseDOList.size() < 1) {
continue;
}
// insertOrUpdate
List<JobSummary> jobSummaryList = jobSummaryList(todayFrom, summaryResponseDOList);
int totalJobSummary = jobSummaryMapper.insertOrUpdate(jobSummaryList);
int totalJobSummary = jobSummaryMapper.insertOrUpdate(jobSummaryList);
EasyRetryLog.LOCAL.debug("job summary dashboard success todayFrom:[{}] todayTo:[{}] total:[{}]", todayFrom, todayTo, totalJobSummary);
}
} catch (Exception e) {

View File

@ -1,7 +1,7 @@
<template>
<div>
<a-row :gutter="24">
<a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<chart-card :loading="loading" :title="$t('dashboard.analysis.total-sales')" :total="retryTask.totalNum">
<a-tooltip title="总任务量: 重试/回调任务量" slot="action">
<a-icon type="info-circle-o" />
@ -31,7 +31,7 @@
</template>
</chart-card>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<chart-card :loading="loading" title="定时任务" :total="jobTask.totalNum">
<a-tooltip title="成功率:总完成/总调度量;" slot="action">
<a-icon type="info-circle-o" />
@ -56,7 +56,34 @@
</template>
</chart-card>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<chart-card :loading="loading" title="工作流任务" :total="jobTask.totalNum"><!-- -->
<a-tooltip title="成功率:总完成/总调度量;" slot="action">
<a-icon type="info-circle-o" />
</a-tooltip>
<div>
<a-tooltip title="成功率">
<a-progress stroke-linecap="square" :percent="jobTask.successRate" />
</a-tooltip>
</div>
<template slot="footer">
{{ $t('dashboard.analysis.job_success') }}
<span>{{ jobTask.successNum }}</span>
<a-divider type="vertical" />
{{ $t('dashboard.analysis.job_fail') }}
<span>{{ jobTask.failNum }}</span>
<a-divider type="vertical" />
{{ $t('dashboard.analysis.job_stop') }}
<span>{{ jobTask.stopNum }}</span>
<a-divider type="vertical" />
{{ $t('dashboard.analysis.job_cancel') }}
<span>{{ jobTask.cancelNum }}</span>
</template>
</chart-card>
</a-col>
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<a href="#" @click="jumpPosList">
<chart-card :loading="loading" title="总在线机器" :total="onLineService.total">
<a-tooltip title="总在线机器:注册到系统的客户端和服务端之和" slot="action" >