lib/rbbt/workflow/util/trace.rb in rbbt-util-5.32.0 vs lib/rbbt/workflow/util/trace.rb in rbbt-util-5.32.1
- old
+ new
@@ -68,12 +68,12 @@
Log.info "Total gaps: #{total_gaps} seconds"
end
start = data.column("Start.second").values.flatten.collect{|v| v.to_f}.min
eend = data.column("End.second").values.flatten.collect{|v| v.to_f}.max
- total = eend - start
- Log.info "Total time elapsed: #{total} seconds"
+ total = eend - start unless eend.nil? || start.nil?
+ Log.info "Total time elapsed: #{total} seconds" if total
data
end
def self.plot_trace_job_times(data, plot, width=800, height=800)
@@ -176,35 +176,35 @@
def self.trace(seed_jobs, options = {})
jobs = []
seed_jobs.each do |step|
jobs += step.rec_dependencies + [step]
-
step.info[:archived_info].each do |path,ainfo|
archived_step = Step.new path
class << archived_step
self
end.define_method :info do
ainfo
end
jobs << archived_step
end if step.info[:archived_info]
+
end
- jobs = jobs.uniq.sort_by{|job| t = job.info[:done]; t || Open.mtime(job.path) || 0 }
+ jobs = jobs.uniq.sort_by{|job| t = job.info[:started]; t || Open.mtime(job.path) || Time.now }
data = trace_job_times(jobs, options[:fix_gap])
report_keys = options[:report_keys] || ""
report_keys = report_keys.split(/,\s*/) if String === report_keys
summary = trace_job_summary(jobs, report_keys)
raise "No jobs to process" if data.size == 0
- plot, size, width, height = options.values_at :plot, :width, :height
+ plot, size, width, height = options.values_at :plot, :size, :width, :height
size = 800 if size.nil?
- width = size * 2 if width.nil?
+ width = size.to_i * 2 if width.nil?
height = size if height.nil?
plot_trace_job_times(data, plot, width, height) if plot
if options[:plot_data]