Skip to content
Snippets Groups Projects
Commit fc92d066 authored by Timothy Andrew's avatar Timothy Andrew
Browse files

Add the "Test" cycle analytics section.

parent 3d5729a7
No related branches found
No related tags found
1 merge request!5986Cycle Analytics: first iteration
Loading
@@ -17,6 +17,12 @@ class CycleAnalytics
Loading
@@ -17,6 +17,12 @@ class CycleAnalytics
Queries::mr_wip_flag_removed_or_assigned_to_user_other_than_author_time) Queries::mr_wip_flag_removed_or_assigned_to_user_other_than_author_time)
end end
   
def test
calculate_metric(Queries::merge_requests_closing_issues,
Queries::mr_build_started_at,
Queries::mr_build_finished_at)
end
def review def review
calculate_metric(Queries::merge_requests_closing_issues, calculate_metric(Queries::merge_requests_closing_issues,
Queries::mr_wip_flag_removed_or_assigned_to_user_other_than_author_time, Queries::mr_wip_flag_removed_or_assigned_to_user_other_than_author_time,
Loading
Loading
Loading
@@ -40,6 +40,28 @@ class CycleAnalytics
Loading
@@ -40,6 +40,28 @@ class CycleAnalytics
end end
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 def mr_deployed_to_any_environment_at
lambda do |data_point| lambda do |data_point|
merge_request = data_point[:merge_request] merge_request = data_point[:merge_request]
Loading
Loading
Loading
@@ -20,6 +20,13 @@
Loading
@@ -20,6 +20,13 @@
- else - else
= "<Not enough data>" = "<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 %li.list-group-item
Review: Review:
- if review = @cycle_analytics.review.presence - if review = @cycle_analytics.review.presence
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment