Dataphin中通过元数据库查看任务节点ID、作业类型、任务节点名、任务状态、调度周期、调度时间;上游任务节点ID和名称、下游任务节点任务和名称
更新时间:
概述
本文介绍现场运维同学如何通过元数据库查询Dataphin环境中任务的节点ID、作业类型、任务节点名、任务状态、调度周期、调度时间等详细信息;查询任务上下游节点任务的ID、名称等信息。
详细信息
具体查询任务节点ID、作业类型、任务节点名、任务状态、调度周期、调度时间等信息,参考如下SQL:
-- 查询当前OneServiceSql类型任务正在运行的数目
select count(*) from vdm_task where operator_type ='ONE_SERVICE_SQL' and task_status = 'RUNNING';
-- 查询某种类型的任务在一段时间内的运行统计情况
select t.task_id,
t.node_id,
m.status,
m.send_to_scheduler_time as start_time ,
m.ack_finish_time as finish_time,
m.pure_execution_time_in_ms,
m.total_execution_time_in_ms
from vdm_measure_taskrun_time_info m
join vdm_task t on m.task_id = t.task_id
where m.ack_finish_time > '2019-12-06'
and m.ack_finish_time < '2019-12-11'
and m.ack_finish_time is not null
and t.tenant_id = '634545'
and t.operator_type = 'DATAX';
select t.task_id,
t.node_id,
m.status,
m.send_to_scheduler_time as start_time ,
m.ack_finish_time as finish_time,
m.pure_execution_time_in_ms,
m.total_execution_time_in_ms
from vdm_measure_taskrun_time_info m
join vdm_task t on m.task_id = t.task_id
where m.ack_finish_time > '2019-12-06'
and m.ack_finish_time < '2019-12-11'
and m.ack_finish_time is not null
and t.tenant_id = '634545'
and t.operator_type = 'DATAX';
-- 查询某种类型的任务在一段时间内的运行统计情况, 执行时间
select count(*) as total,
avg(m.pure_execution_time_in_ms) as avg_pure_executeTime,
avg(m.total_execution_time_in_ms) as avg_total_executeTime
from vdm_measure_taskrun_time_info m
join vdm_task t on m.task_id = t.task_id
where m.ack_finish_time > '2019-12-06'
and m.ack_finish_time < '2019-12-11'
and m.ack_finish_time is not null
and t.tenant_id = '634545'
and t.operator_type = 'DATAX';
-- 查询某种类型的任务在一段时间内的运行统计情况, 执行状态
select m.status,
count(m.status) as count
from vdm_measure_taskrun_time_info m
join vdm_task t on m.task_id = t.task_id
where m.ack_finish_time > '2019-12-06'
and m.ack_finish_time < '2019-12-11'
and m.ack_finish_time is not null
and t.operator_type = 'DATAX'
and t.tenant_id = '634545'
group by m.status;
查询任务的上下游任务的节点ID、任务名称:
需要vdm_edge表里面节点id, vdm_task表里面node_id进行关联管理查询。vdm_edge表,的source_node_id, target_node_id分别是上游和下游节点Id。基本上看下表结构就知道怎么查询了。
适用于
Dataphin
反馈
- 本页导读
文档反馈