gitlab-org--gitlab-foss/lib/gitlab/cycle_analytics/summary_helper.rb

16 lines
311 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module SummaryHelper
def frequency(count, from, to)
(count / days(from, to)).round(1)
end
def days(from, to)
[(to.end_of_day - from.beginning_of_day) / (24 * 60 * 60), 1].max
end
end
end
end