diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-15 00:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-15 00:09:27 +0300 |
commit | 9689350c651e2428924ea1096905278536f1dc7a (patch) | |
tree | 5b0d455b6cad04f36cfb57c5a6c771edf4e45e09 /app/models/product_analytics_event.rb | |
parent | a8caa9ce4922947ba057f259bccd017c2177e1b5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/product_analytics_event.rb')
-rw-r--r-- | app/models/product_analytics_event.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/product_analytics_event.rb b/app/models/product_analytics_event.rb index fcd2027a46b..d2026d3b333 100644 --- a/app/models/product_analytics_event.rb +++ b/app/models/product_analytics_event.rb @@ -26,6 +26,13 @@ class ProductAnalyticsEvent < ApplicationRecord group(graph).timerange(days).count end + def self.count_collector_tstamp_by_day(days) + group("DATE_TRUNC('day', collector_tstamp)") + .reorder('date_trunc_day_collector_tstamp') + .timerange(days) + .count + end + def as_json_wo_empty as_json.compact end |