lib/rbbt/workflow/util/trace.rb in rbbt-util-5.32.2 vs lib/rbbt/workflow/util/trace.rb in rbbt-util-5.32.4
- old
+ new
@@ -8,10 +8,13 @@
jobs.each do |job|
next unless job.info[:done]
started = job.info[:started]
ddone = job.info[:done]
+ started = Time.parse started if String === started
+ ddone = Time.parse ddone if String === ddone
+
code = [job.workflow, job.task_name].compact.collect{|s| s.to_s} * " ยท "
code = job.name + " - " + code
data[job.path] = [code,job.workflow.to_s, job.task_name, started, ddone]
if min_start.nil?
@@ -138,11 +141,17 @@
next unless dep.info[:done]
task = [dep.workflow, dep.task_name].compact.collect{|s| s.to_s} * "#"
info = tasks_info[task] ||= IndiferentHash.setup({})
dep_info = IndiferentHash.setup(dep.info)
- time = dep_info[:done] - dep_info[:started]
+ ddone = dep_info[:done]
+ started = dep_info[:started]
+
+ started = Time.parse started if String === started
+ ddone = Time.parse ddone if String === ddone
+
+ time = ddone - started
info[:time] ||= []
info[:time] << time
report_keys.each do |key|
info[key] = dep_info[key]
@@ -194,10 +203,10 @@
jobs << archived_step
end if step.info[:archived_info]
end
- jobs = jobs.uniq.sort_by{|job| t = job.info[:started]; t || Open.mtime(job.path) || Time.now }
+ jobs = jobs.uniq.sort_by{|job| t = job.info[:started] || Open.mtime(job.path) || Time.now; Time === t ? t : Time.parse(t) }
data = trace_job_times(jobs, options[:fix_gap])
report_keys = options[:report_keys] || ""
report_keys = report_keys.split(/,\s*/) if String === report_keys