Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
//  API method name: get_job_statistics
select jb.job_id, jb_inst.job_instance_id, jb_inst.job_submit_seq, jb.exec_job_id as job_name, jb_inst.site as site,
 (
  (select min(timestamp) FROM jobstate WHERE job_instance_id = jb_inst.job_instance_id and (state = 'GRID_SUBMIT' or state = 'GLOBUS_SUBMIT' or state = 'EXECUTE'))
  -
  (select timestamp FROM jobstate WHERE job_instance_id = jb_inst.job_instance_id and state = 'SUBMIT')
 ) as condor_q_time,
 (
  (select min(timestamp) FROM jobstate where job_instance_id = jb_inst.job_instance_id and state = 'EXECUTE' )
  -
  (select min(timestamp) FROM jobstate where job_instance_id = jb_inst.job_instance_id and (state='SUBMIT' or state = 'GRID_SUBMIT' or state ='GLOBUS_SUBMIT'))
 ) as resource_delay,
jb_inst.local_duration as runtime,
 (
  (select sum(remote_duration) FROM invocation as invoc WHERE job_instance_id = jb_inst.job_instance_id and wf_id = jb.wf_id and task_submit_seq >=0 GROUP BY job_instance_id)
 ) as kickstart,
 (
  (select timestamp from jobstate where job_instance_id = jb_inst.job_instance_id and state = 'POST_SCRIPT_TERMINATED')
  -
  (select max(timestamp) from jobstate  where job_instance_id = jb_inst.job_instance_id  and (state ='POST_SCRIPT_STARTED' or state ='JOB_TERMINATED'))
 ) as post_time,
jb_inst.cluster_duration as seqexec,
 (
  (select max(exitcode) from invocation as invoc where job_instance_id = jb_inst.job_instance_id and wf_id = jb.wf_id and task_submit_seq >=0 group by job_instance_id)
 ) as exit_code,
 (
  (select h.hostname from host h, job_instance ji where ji.job_instance_id = jb_inst.job_instance_id and h.host_id = ji.host_id and h.wf_id = 1 GROUP BY ji.job_instance_id)
 ) as host_name,
 multiplier_factor,
 (
  (select sum(remote_duration * multiplier_factor) FROM invocation as invoc WHERE job_instance_id = jb_inst.job_instance_id and wf_id = jb.wf_id and task_submit_seq >=0 GROUP BY job_instance_id)
 ) as kickstart_multi,
 (
  (select sum(remote_cpu_time) FROM invocation as invoc WHERE job_instance_id = jb_inst.job_instance_id and wf_id = jb.wf_id and task_submit_seq >=0 GROUP BY job_instance_id)
 ) as remote_cpu_time