BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fc92d066
Commit
fc92d066
authored
Aug 25, 2016
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the "Test" cycle analytics section.
parent
3d5729a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
cycle_analytics.rb
app/models/cycle_analytics.rb
+6
-0
queries.rb
app/models/cycle_analytics/queries.rb
+22
-0
show.html.haml
app/views/projects/cycle_analytics/show.html.haml
+7
-0
No files found.
app/models/cycle_analytics.rb
View file @
fc92d066
...
...
@@ -17,6 +17,12 @@ class CycleAnalytics
Queries
::
mr_wip_flag_removed_or_assigned_to_user_other_than_author_time
)
end
def
test
calculate_metric
(
Queries
::
merge_requests_closing_issues
,
Queries
::
mr_build_started_at
,
Queries
::
mr_build_finished_at
)
end
def
review
calculate_metric
(
Queries
::
merge_requests_closing_issues
,
Queries
::
mr_wip_flag_removed_or_assigned_to_user_other_than_author_time
,
...
...
app/models/cycle_analytics/queries.rb
View file @
fc92d066
...
...
@@ -40,6 +40,28 @@ class CycleAnalytics
end
end
def
mr_build_started_at
lambda
do
|
data_point
|
merge_request
=
data_point
[
:merge_request
]
tip
=
merge_request
.
commits
.
first
return
unless
tip
pipeline
=
Ci
::
Pipeline
.
find_by_sha
(
tip
.
sha
)
pipeline
.
started_at
if
pipeline
end
end
def
mr_build_finished_at
lambda
do
|
data_point
|
merge_request
=
data_point
[
:merge_request
]
tip
=
merge_request
.
commits
.
first
return
unless
tip
pipeline
=
Ci
::
Pipeline
.
find_by_sha
(
tip
.
sha
)
pipeline
.
finished_at
if
pipeline
end
end
def
mr_deployed_to_any_environment_at
lambda
do
|
data_point
|
merge_request
=
data_point
[
:merge_request
]
...
...
app/views/projects/cycle_analytics/show.html.haml
View file @
fc92d066
...
...
@@ -21,6 +21,13 @@
=
"<Not enough data>"
%li
.list-group-item
Test:
-
if
test
=
@cycle_analytics
.
test
.
presence
=
distance_of_time_in_words
test
-
else
=
"<Not enough data>"
%li
.list-group-item
Review:
-
if
review
=
@cycle_analytics
.
review
.
presence
=
distance_of_time_in_words
review
...
...
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