X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c86a3350fe212e35a7d745d5607fbc27bc1fd3c8..78408743bab09078a7361620fc6a6be524fdac73:/apps/workbench/app/helpers/pipeline_instances_helper.rb diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb index 939ddcb43e..1ed9e3ed6b 100644 --- a/apps/workbench/app/helpers/pipeline_instances_helper.rb +++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb @@ -69,9 +69,8 @@ module PipelineInstancesHelper def determine_wallclock_runtime jobs timestamps = [] jobs.each do |j| - insert_at = 0 - started_at = j[:started_at] - finished_at = (if j[:finished_at] then j[:finished_at] else Time.now end) + started_at = (j.started_at if j.respond_to?(:started_at)) || (j[:started_at] if j.is_a?(Hash)) + finished_at = (j.finished_at if j.respond_to?(:finished_at)) || (j[:finished_at] if j.is_a?(Hash)) || Time.now if started_at timestamps = merge_range timestamps, started_at, finished_at end @@ -289,7 +288,7 @@ module PipelineInstancesHelper else s = "" if days > 0 - s += "#{days}d " + s += "#{days}d" end if (hours > 0) @@ -298,7 +297,7 @@ module PipelineInstancesHelper s += "#{minutes}m" - if not round_to_min + if not round_to_min or (days == 0 and hours == 0 and minutes == 0) s += "#{seconds}s" end end @@ -306,19 +305,6 @@ module PipelineInstancesHelper raw(s) end - def render_runtime_compact duration - if duration >= DAY - "#{(duration / DAY.to_f).round(2)} days" - elsif duration >= HOUR - "#{(duration / HOUR.to_f).round(2)} hours" - elsif duration >= MINUTE - "#{(duration / MINUTE.to_f).round(2)} minutes" - else - seconds = duration.round(2) - "#{seconds} second#{'s' if seconds != 1}" - end - end - def render_unreadable_inputs_present if current_user and controller.class.name.eql?('PipelineInstancesController') and unreadable_inputs_present? raw('
' +