diff options
author | Nick Thomas <nick@gitlab.com> | 2019-02-27 12:07:05 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-02-27 12:07:05 +0000 |
commit | a5174cf0fcfd0ae77d25ac5208b7aa371d7d7b73 (patch) | |
tree | 6610d4dbd0b47f666586e7f5e0e87a285a3426c5 /app/finders | |
parent | 61c1509cc992959ac5021d10825d5dbf9dd2c091 (diff) | |
parent | 5ae9a44aa17c8929627cc450f936cd960c143e25 (diff) | |
download | gitlab-ce-a5174cf0fcfd0ae77d25ac5208b7aa371d7d7b73.tar.gz |
Merge branch '42086-project-fetch-statistics-api-http-only' into 'master'57125-heatmap-chart-type
Resolve "Project fetch statistics API (HTTP only)"
Closes #42086
See merge request gitlab-org/gitlab-ce!23596
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/projects/daily_statistics_finder.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/finders/projects/daily_statistics_finder.rb b/app/finders/projects/daily_statistics_finder.rb new file mode 100644 index 00000000000..912c23107bc --- /dev/null +++ b/app/finders/projects/daily_statistics_finder.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Projects + class DailyStatisticsFinder + attr_reader :project + + def initialize(project) + @project = project + end + + def fetches + ProjectDailyStatistic.of_project(project) + .of_last_30_days + .sorted_by_date_desc + end + + def total_fetch_count + fetches.sum_fetch_count + end + end +end |