INFO-新版任务运维中心统计脚本

适用模块

新版任务运维中心

具体说明

实例大盘概览信息

使用示例

easytaskops
1、总任务数

select count(*) from eto_az_flow where cluster = 'easyops-cluster' and product='intern_a';

2、调度任务数

sched_status枚举:开启调度:1;未调度:0
select count(*) from eto_az_flow where cluster = 'easyops-cluster' and product='intern_a' and sched_status = 1;

3、当天生成的实例数(不包括未到时间点未生成的实例)
exec_type枚举:
- 调度实例:SCHEDULE
- 调度重跑实例:RERUN
- 补数据重跑实例:LINKED_BACKFILL_RERUN
- 补数据实例:LINKED_BACKFILL_EXECUTE
sched_time:调度时间,毫秒

select count(*) from eto_az_exec_flow where cluster = 'easyops-cluster' and product='intern_a' and exec_type='SCHEDULE' and sched_time>=1645718400000 and sched_time < 1645804800000

4、当天成功实例数
exec_status枚举:
- 就绪中:PREPARING
- 运行中:RUNNING
- 暂停:PAUSED
- 成功:SUCCEEDED
- 失败:FAILED
- 终止:KILLED
- 终止中:KILLING
- 运行中异常:FAILED_FINISHING

select count(*) from eto_az_exec_flow where cluster = 'easyops-cluster' and product='intern_a' and exec_type='SCHEDULE' and sched_time>=1645718400000 and sched_time < 1645804800000 and exec_status='SUCCESS'

5、当天成功节点数

status枚举:
- 就绪中:READY
- 运行中:RUNNING
- 成功:SUCCEEDED
- 失败:FAILED
- 终止:KILLED
- 撤销(上游失败后,下游会变成这个状态,不执行):CANCELLED
- 等到队列:QUEUED

select count(*) from eto_az_exec_job where cluster = 'easyops-cluster' and product='intern_a' and exec_type='SCHEDULE' and sched_time>=1645718400000 and sched_time < 1645804800000 and status='SUCCESS'

6、标签关联任务信息

SELECT flow.cluster ,flow.product ,flow_name, tag_name, tag_value FROM eto_az_flow flow JOIN eto_flow_tag flow_tag ON flow_tag.eto_flow_id = flow.id JOIN product_tag_configs tc ON tc.id = flow_tag.tag_value_id JOIN product_tag t ON t.id = tc.tag_id where flow.sched_status = 1

作者:林帅