diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /lib/gitlab/cycle_analytics/summary/group/deployment_frequency.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'lib/gitlab/cycle_analytics/summary/group/deployment_frequency.rb')
-rw-r--r-- | lib/gitlab/cycle_analytics/summary/group/deployment_frequency.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/gitlab/cycle_analytics/summary/group/deployment_frequency.rb b/lib/gitlab/cycle_analytics/summary/group/deployment_frequency.rb new file mode 100644 index 00000000000..9fbbbb5a1ec --- /dev/null +++ b/lib/gitlab/cycle_analytics/summary/group/deployment_frequency.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Gitlab + module CycleAnalytics + module Summary + module Group + class DeploymentFrequency < Group::Base + include GroupProjectsProvider + include SummaryHelper + + def initialize(deployments:, group:, options:) + @deployments = deployments + + super(group: group, options: options) + end + + def title + _('Deployment Frequency') + end + + def value + @value ||= + frequency(@deployments, options[:from], options[:to] || Time.now) + end + + def unit + _('per day') + end + end + end + end + end +end |