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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f2be6cf1
Commit
f2be6cf1
authored
Oct 12, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add total duration of all pipelines to CI/CD analytics
parent
44ac5b48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
app/assets/javascripts/projects/pipelines/charts/components/statistics_list.vue
.../projects/pipelines/charts/components/statistics_list.vue
+38
-16
app/assets/javascripts/projects/pipelines/charts/index.js
app/assets/javascripts/projects/pipelines/charts/index.js
+2
-0
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+1
-0
No files found.
app/assets/javascripts/projects/pipelines/charts/components/statistics_list.vue
View file @
f2be6cf1
<
script
>
import
{
formatPipelineDuration
}
from
'
~/pipelines/utils
'
;
import
{
s__
,
n__
}
from
'
~/locale
'
;
export
default
{
props
:
{
counts
:
{
...
...
@@ -6,25 +9,44 @@ export default {
required
:
true
,
},
},
computed
:
{
totalDuration
()
{
return
formatPipelineDuration
(
this
.
counts
.
totalDuration
);
},
entries
()
{
return
[
{
title
:
s__
(
'
PipelineCharts|Total:
'
),
value
:
n__
(
'
1 pipeline
'
,
'
%d pipelines
'
,
this
.
counts
.
total
),
},
{
title
:
s__
(
'
PipelineCharts|Successful:
'
),
value
:
n__
(
'
1 pipeline
'
,
'
%d pipelines
'
,
this
.
counts
.
success
),
},
{
title
:
s__
(
'
PipelineCharts|Failed:
'
),
value
:
n__
(
'
1 pipeline
'
,
'
%d pipelines
'
,
this
.
counts
.
failed
),
},
{
title
:
s__
(
'
PipelineCharts|Success ratio:
'
),
value
:
`
${
this
.
counts
.
successRatio
}
%`
,
},
{
title
:
s__
(
'
PipelineCharts|Total duration:
'
),
value
:
this
.
totalDuration
,
},
];
},
},
};
</
script
>
<
template
>
<ul>
<li>
<span>
{{
s__
(
'
PipelineCharts|Total:
'
)
}}
</span>
<strong>
{{
n__
(
'
1 pipeline
'
,
'
%d pipelines
'
,
counts
.
total
)
}}
</strong>
</li>
<li>
<span>
{{
s__
(
'
PipelineCharts|Successful:
'
)
}}
</span>
<strong>
{{
n__
(
'
1 pipeline
'
,
'
%d pipelines
'
,
counts
.
success
)
}}
</strong>
</li>
<li>
<span>
{{
s__
(
'
PipelineCharts|Failed:
'
)
}}
</span>
<strong>
{{
n__
(
'
1 pipeline
'
,
'
%d pipelines
'
,
counts
.
failed
)
}}
</strong>
</li>
<li>
<span>
{{
s__
(
'
PipelineCharts|Success ratio:
'
)
}}
</span>
<strong>
{{
counts
.
successRatio
}}
%
</strong>
</li>
<template
v-for=
"(
{ title, value }, index) in entries">
<li
:key=
"index"
>
<span>
{{
title
}}
</span>
<strong>
{{
value
}}
</strong>
</li>
</
template
>
</ul>
</template>
app/assets/javascripts/projects/pipelines/charts/index.js
View file @
f2be6cf1
...
...
@@ -7,6 +7,7 @@ export default () => {
countsFailed
,
countsSuccess
,
countsTotal
,
countsTotalDuration
,
successRatio
,
timesChartLabels
,
timesChartValues
,
...
...
@@ -41,6 +42,7 @@ export default () => {
success
:
countsSuccess
,
total
:
countsTotal
,
successRatio
,
totalDuration
:
countsTotalDuration
,
},
timesChartData
:
{
labels
:
JSON
.
parse
(
timesChartLabels
),
...
...
app/controllers/projects/pipelines_controller.rb
View file @
f2be6cf1
...
...
@@ -193,6 +193,7 @@ class Projects::PipelinesController < Projects::ApplicationController
@counts
[
:total
]
=
@project
.
all_pipelines
.
count
(
:all
)
@counts
[
:success
]
=
@project
.
all_pipelines
.
success
.
count
(
:all
)
@counts
[
:failed
]
=
@project
.
all_pipelines
.
failed
.
count
(
:all
)
@counts
[
:total_duration
]
=
@project
.
all_pipelines
.
total_duration
end
def
test_report
...
...
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