Commit 6e1a06d8 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Show how long this pipeline was queued

Closes #19804
parent d071f61b
...@@ -257,6 +257,13 @@ module Ci ...@@ -257,6 +257,13 @@ module Ci
] ]
end end
def queued_duration
return unless started_at
seconds = (started_at - created_at).to_i
seconds unless seconds.zero?
end
def update_duration def update_duration
return unless started_at return unless started_at
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
- if @pipeline.duration - if @pipeline.duration
in in
= time_interval_in_words(@pipeline.duration) = time_interval_in_words(@pipeline.duration)
- if @pipeline.queued_duration
(queued for
= "#{time_interval_in_words(@pipeline.queued_duration)})"
.pull-right .pull-right
= link_to namespace_project_pipeline_path(@project.namespace, @project, @pipeline), class: "ci-status ci-#{@pipeline.status}" do = link_to namespace_project_pipeline_path(@project.namespace, @project, @pipeline), class: "ci-status ci-#{@pipeline.status}" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment