Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
5643cd6b
Commit
5643cd6b
authored
Aug 09, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show wall-clock time when showing pipeline instead of:
cumulative builds time. Closes #17007
parent
551ffc0a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
app/helpers/time_helper.rb
app/helpers/time_helper.rb
+5
-0
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+4
-0
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+2
-2
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+2
-2
No files found.
app/helpers/time_helper.rb
View file @
5643cd6b
...
...
@@ -17,6 +17,11 @@ module TimeHelper
def
duration_in_numbers
(
finished_at
,
started_at
)
interval
=
interval_in_seconds
(
started_at
,
finished_at
)
duration_in_numbers_from_interval
(
interval
)
end
def
duration_in_numbers_from_interval
(
interval
)
time_format
=
interval
<
1
.
hour
?
"%M:%S"
:
"%H:%M:%S"
Time
.
at
(
interval
).
utc
.
strftime
(
time_format
)
...
...
app/models/ci/pipeline.rb
View file @
5643cd6b
...
...
@@ -213,6 +213,10 @@ module Ci
]
end
def
wall_clock_duration
finished_at
.
to_i
-
started_at
.
to_i
if
finished_at
&&
started_at
end
private
def
build_builds_for_stages
(
stages
,
user
,
status
,
trigger_request
)
...
...
app/views/projects/ci/pipelines/_pipeline.html.haml
View file @
5643cd6b
...
...
@@ -46,10 +46,10 @@
\-
%td
-
if
pipeline
.
started_at
&&
pipeline
.
finished_at
-
if
pipeline
.
wall_clock_duration
%p
.duration
=
custom_icon
(
"icon_timer"
)
=
duration_in_numbers
(
pipeline
.
finished_at
,
pipeline
.
started_at
)
=
duration_in_numbers
_from_interval
(
pipeline
.
wall_clock_duration
)
-
if
pipeline
.
finished_at
%p
.finished-at
=
icon
(
"calendar"
)
...
...
app/views/projects/pipelines/_info.html.haml
View file @
5643cd6b
...
...
@@ -7,9 +7,9 @@
-
if
@pipeline
.
ref
for
=
link_to
@pipeline
.
ref
,
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@pipeline
.
ref
),
class:
"monospace"
-
if
@pipeline
.
duration
-
if
@pipeline
.
wall_clock_
duration
in
=
time_interval_in_words
@pipeline
.
duration
=
time_interval_in_words
(
@pipeline
.
wall_clock_duration
)
.pull-right
=
link_to
namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
class:
"ci-status ci-
#{
@pipeline
.
status
}
"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment